mirror of
https://github.com/nodejs/node.git
synced 2026-12-06 03:29:00 -05:00
timers: call destroy on interval error
When an interval callback throws an error, the destroy hook is never called due to a faulty if condition. PR-URL: https://github.com/nodejs/node/pull/20001 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
This commit is contained in:
2 files changed
+38
-1
No files matched your search
+1
-1
@@ -292,7 +292,7 @@ function tryOnTimeout(timer, start) {
|
||||
if (timerAsyncId !== null) {
|
||||
if (!threw)
|
||||
emitAfter(timerAsyncId);
|
||||
if (!timer._repeat && destroyHooksExist() &&
|
||||
if ((threw || !timer._repeat) && destroyHooksExist() &&
|
||||
!timer._destroyed) {
|
||||
emitDestroy(timerAsyncId);
|
||||
timer._destroyed = true;
|
||||
|
||||
Reference in new issue
Block a user