Skip to content

Commit eb071fc

Browse files
authored
Update AdaptiveTimerMethod.php
1 parent caa49cb commit eb071fc

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/Builders/Traits/AdaptiveTimerMethod.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,12 @@ public function adaptiveTimerDelete(?string $id = null): void
264264
}
265265
if ($id === null) {
266266
foreach(self::$timerIdMap as $id) {
267-
if (is_worker_version_5() and method_exists(Worker::$globalEvent, 'offDelay')) {
268-
Worker::$globalEvent->offDelay($id);
269-
} else {
270-
Worker::$globalEvent->del($id, EventInterface::EV_TIMER);
267+
if (is_int($id)) {
268+
if (is_worker_version_5() and method_exists(Worker::$globalEvent, 'offDelay')) {
269+
Worker::$globalEvent->offDelay($id);
270+
} else {
271+
Worker::$globalEvent->del($id, EventInterface::EV_TIMER);
272+
}
271273
}
272274
}
273275
self::$timerIdMap = [];
@@ -282,4 +284,4 @@ public function adaptiveTimerDelete(?string $id = null): void
282284
}
283285
}
284286
}
285-
}
287+
}

0 commit comments

Comments
 (0)