|
@@ -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
|
}; |