diff options
author | 2022-08-08 00:23:45 +0800 | |
---|---|---|
committer | 2022-08-07 09:23:45 -0700 | |
commit | 6b45f39322384895a580e854a93fa61816f63b47 (patch) | |
tree | 359b16a4294afdd27e0c17ed30cfc0d1d8a24aec | |
parent | 31b8ad823066f962cb75fb1470a5a203d456c2a2 (diff) | |
download | bun-6b45f39322384895a580e854a93fa61816f63b47.tar.gz bun-6b45f39322384895a580e854a93fa61816f63b47.tar.zst bun-6b45f39322384895a580e854a93fa61816f63b47.zip |
re-register setInterval to VM after completion (#1014)
-rw-r--r-- | src/bun.js/api/bun.zig | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/bun.js/api/bun.zig b/src/bun.js/api/bun.zig index 708467402..32e0d04e5 100644 --- a/src/bun.js/api/bun.zig +++ b/src/bun.js/api/bun.zig @@ -2261,6 +2261,9 @@ pub const Timer = struct { if (this.repeat) { this.io_task.?.deinit(); var task = Timeout.TimeoutTask.createOnJSThread(VirtualMachine.vm.allocator, global, this) catch unreachable; + VirtualMachine.vm.timer.timeouts.put(VirtualMachine.vm.allocator, this.id, this) catch unreachable; + VirtualMachine.vm.timer.active +|= 1; + VirtualMachine.vm.active_tasks +|= 1; this.io_task = task; task.schedule(); } |