diff --git a/bin/run.js b/bin/run.js index 5033b4ac3..0832fef1f 100644 --- a/bin/run.js +++ b/bin/run.js @@ -41,6 +41,9 @@ if (require.main !== module) { // If run.js is required by another module (for e describe: 'Log config', 'default': true, }) + .options('primary', { + describe: 'Run as primary instance', + }) .argv; const config = require('../config'); @@ -53,6 +56,7 @@ if (require.main !== module) { // If run.js is required by another module (for e const appName = path.parse(argv.script).name; const logger = log4js.getLogger(appName); if (appName === "notifier") config.notifier = true; + config.primary = !!argv.primary; // If not true, the instance will run as a recplica // Handling uncaught exceptions process.on('uncaughtException', err => { diff --git a/config/default.config.js b/config/default.config.js index 8ac531a93..c56dc36f7 100644 --- a/config/default.config.js +++ b/config/default.config.js @@ -5,7 +5,6 @@ module.exports = { env: 'development', // Enviroment: development, testing, production locales: ['en', 'ru'], // List of supported locales. First one is the default locale, if user transferred nothing lang: 'ru', // Language: ru, en - primary: false, // If not true, the instance will run as a recplica admin: { email: '', }, diff --git a/config/local.config.js.docker-example b/config/local.config.js.docker-example index 5238eef1c..cb64804ac 100644 --- a/config/local.config.js.docker-example +++ b/config/local.config.js.docker-example @@ -3,7 +3,6 @@ module.exports = function (config, appRequire) { _.merge(config, { // Send periodical emails to users depending on environment variable - primary: true, client: { hostname: 'localhost', }, diff --git a/config/local.config.js.example b/config/local.config.js.example index ac68f91d2..bcc42e159 100644 --- a/config/local.config.js.example +++ b/config/local.config.js.example @@ -2,7 +2,6 @@ module.exports = function (config, appRequire) { const _ = appRequire('lodash'); _.merge(config, { - primary: true, client: { hostname: 'pastvu.local', }, diff --git a/docker-compose.yml b/docker-compose.yml index 1f419b2b5..8fc00eb9c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -35,7 +35,7 @@ services: volumes: - .:/code - store:/store - command: run app + command: run app --primary notifier: << : *app-image