We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
var Promise = require('bluebird'); var micro = require('micro'); var fs = require('fs'); var os = require('os'); var cluster = require('cluster'); global.config = require(process.env.ENGINE_PATH + '/configs.js')[process.env.ENGINE_ENVIRONMENT]; var logger = require(process.env.ENGINE_PATH + '/lib/logger.js'); var router = require(process.env.ENGINE_PATH + '/lib/router.js'); var routes = require(process.env.ENGINE_PATH + '/routes/index.js'); var spawnThreads = function() { for (var i = 0; i < os.cpus().length; ++i) { var worker = cluster.fork(); logger.log({level: 'info', message: `Spawned worker ${worker.id}...`}); } }; var bindServers = function() { var server = micro(router(routes)); server.listen(global.config.port, function() { logger.log({level: 'info', message: 'Engine server listening...', port: global.config.port}); }); }; (async function() { if (cluster.isMaster) { process.on('exit', function() { console.error('HERE'); fs.unlinkSync(process.env.ENGINE_PATH + '/engine.pid'); }); spawnThreads(); } else { bindServers(); } })();
The process.on('exit' never gets called from the master... do you have any advice on this?
The text was updated successfully, but these errors were encountered:
Anyone found a solution to this issue?
Sorry, something went wrong.
No branches or pull requests
The process.on('exit' never gets called from the master... do you have any advice on this?
The text was updated successfully, but these errors were encountered: