UNPKG

389 BJavaScriptView Raw
1'use strict';
2
3function unrefTimeout(fn, timeout) {
4 if (!timeout) { timeout = 1500; }
5
6 const t = setTimeout(fn, timeout);
7
8 t.unref();
9}
10
11const 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
19module.exports = { unrefTimeout, autoExit };
\No newline at end of file