mirror of https://github.com/nodejs/node.git
timers: remove redundant unref calls
PR-URL: https://github.com/nodejs/node/pull/38320 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>pull/38320/head
parent
04ec693a30
commit
d9b56fe295
|
@ -61,8 +61,7 @@ function setTimeout(after, value, options = {}) {
|
|||
}
|
||||
let oncancel;
|
||||
const ret = new Promise((resolve, reject) => {
|
||||
const timeout = new Timeout(resolve, after, args, false, true);
|
||||
if (!ref) timeout.unref();
|
||||
const timeout = new Timeout(resolve, after, args, false, ref);
|
||||
insert(timeout, timeout._idleTimeout);
|
||||
if (signal) {
|
||||
oncancel = FunctionPrototypeBind(cancelListenerHandler,
|
||||
|
@ -141,8 +140,7 @@ async function* setInterval(after, value, options = {}) {
|
|||
callback();
|
||||
callback = undefined;
|
||||
}
|
||||
}, after, undefined, true, true);
|
||||
if (!ref) interval.unref();
|
||||
}, after, undefined, true, ref);
|
||||
insert(interval, interval._idleTimeout);
|
||||
if (signal) {
|
||||
onCancel = () => {
|
||||
|
|
Loading…
Reference in New Issue