Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

feat: allow tasks to be canceled and rescheduled on different zone in… #629

Merged
merged 1 commit into from
Feb 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/common/timers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ export function patchTimer(window: any, setName: string, cancelName: string, nam
patchMethod(window, cancelName, (delegate: Function) => function(self: any, args: any[]) {
const task: Task = typeof args[0] === 'number' ? tasksByHandleId[args[0]] : args[0];
if (task && typeof task.type === 'string') {
if (task.cancelFn && task.data.isPeriodic || task.runCount === 0) {
if (task.state !== 'notScheduled' &&
(task.cancelFn && task.data.isPeriodic || task.runCount === 0)) {
// Do not cancel already canceled functions
task.zone.cancelTask(task);
}
Expand Down
Loading