if (process.env.NODE_ENV === 'production') { |
17 | var requestData = { |
18 | method: 'POST', |
19 | timeout: 60000, |
20 | rejectUnauthorized: false, |
21 | uri: 'http://' + process.env.NSQ_LOOKUP_HOST + ':' + process.env.NSQ_LOOKUP_PORT + '/put?topic=Esb_New_Nodejs_App_Restart_Monitor', |
22 | headers: { |
23 | 'Content-Type': 'application/json', |
24 | 'Connection': 'Keep-Alive' |
25 | }, |
26 | form: { |
27 | 'appName': process.env.APP_NAME, |
28 | 'appHostName': process.env.APP_HOST_NAME + ":" + process.env.PORT, |
29 | 'env': process.env.NODE_ENV |
30 | } |
31 | }; |
32 | request(requestData, function (err, res, body) { |
33 | if (err) { |
34 | logger.error('Initialize esb_new nodejs restart monitor err: %s', err.stack); |
35 | } |
36 | }); |
37 | } |