1 | ;
|
2 |
|
3 | function unrefTimeout(fn, timeout) {
|
4 | if (!timeout) { timeout = 1500; }
|
5 |
|
6 | const t = setTimeout(fn, timeout);
|
7 |
|
8 | t.unref();
|
9 | }
|
10 |
|
11 | const autoExit = () => {
|
12 | // fix not auto exit bug after docker operation
|
13 | unrefTimeout(() => {
|
14 | // in order visitor request has been sent out
|
15 | process.exit(0); // eslint-disable-line
|
16 | });
|
17 | };
|
18 |
|
19 | module.exports = { unrefTimeout, autoExit }; |
\ | No newline at end of file |