Authored by 陈峰

commit

@@ -119,16 +119,17 @@ exports.createApp = async (app) => { @@ -119,16 +119,17 @@ exports.createApp = async (app) => {
119 119
120 // YOHO 后置中间件 120 // YOHO 后置中间件
121 app.use(errorHanlder.serverError()); 121 app.use(errorHanlder.serverError());
  122 +
  123 + // listener
  124 + app.listen(config.port, function() {
  125 + logger.info(`worker is started at ${config.port}`);
  126 + });
122 } catch (err) { 127 } catch (err) {
123 if (err.code === 9999) { 128 if (err.code === 9999) {
124 logger.error(err); 129 logger.error(err);
125 - throw JSON.stringify(err); 130 + process.abort();
126 } 131 }
127 logger.error(err); 132 logger.error(err);
128 } 133 }
129 134
130 - // listener  
131 - app.listen(config.port, function() {  
132 - logger.info(`worker is started at ${config.port}`);  
133 - });  
134 }; 135 };
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 { 3 {
4 "name": "yohoblk-wap", 4 "name": "yohoblk-wap",
5 "script": "app.js", 5 "script": "app.js",
6 - "instances": "max", 6 + "instances": "4",
7 "exec_mode": "cluster", 7 "exec_mode": "cluster",
8 "merge_logs": true, 8 "merge_logs": true,
9 "log_date_format": "YYYY-MM-DD HH:mm:ss Z", 9 "log_date_format": "YYYY-MM-DD HH:mm:ss Z",