-
-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(auto_discover): Add option to quit on discovery errors
This adds a new config option, `api.targets.auto_discover_required`. If set to true, the API will quit with a fatal error if there is any problem performing the type mapping discovery. In practice what this means is a working Elasticsearch cluster with a valid Pelias index must exist and be properly configured in `pelias.json`, or the API won't start. This can actually be quite helpful in production environments as it can protect against misconfiguration issues such as using the wrong URL to the Elasticsearch cluster. Because the check is only performed once at startup, it won't cause the API to quit if there's an intermittent network issue or something similar later on. Connects #1591 Connects pelias/pelias#925
- Loading branch information
1 parent
5272f25
commit ade4de6
Showing
5 changed files
with
39 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
const TypeMapping = require('./TypeMapping'); | ||
|
||
// instantiate a new type mapping | ||
// instantiate a singleton type mapping | ||
// loading normal defaults from pelias-config happens now | ||
// updating that config from Elasticsearch happens later | ||
// before the webserver is started | ||
var tm = new TypeMapping(); | ||
tm.load(); | ||
tm.loadFromConfig(); | ||
|
||
// export singleton | ||
module.exports = tm; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters