Skip to content

Commit

Permalink
supporting cluster mode
Browse files Browse the repository at this point in the history
  • Loading branch information
m-inh committed Oct 2, 2018
1 parent 8e402a7 commit 72f1a79
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
16 changes: 16 additions & 0 deletions ecosystem.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
apps: [
{
name: 'chatbot',
script: 'index.js',
exec_mode: 'cluster',
instances: 0
},
{
name: 'schedule_chatbot',
script: 'schedule.js',
exec_mode: 'fork',
instances: 1
}
]
};
7 changes: 1 addition & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,4 @@ global.Models = require('./models/Models');
/**
* Main app.
*/
require('./app/main');

/**
* Scheduler for user matching
*/
require('./scheduler');
require('./app/main');
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@
"devDependencies": {
"knex": "^0.13.0"
}
}
}
1 change: 1 addition & 0 deletions schedule.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require('./schedule');

0 comments on commit 72f1a79

Please sign in to comment.