1
0
mirror of https://github.com/danog/amp.git synced 2025-01-22 05:11:42 +01:00

Always use persistent flag for timer

cancel() is called when delay timers are executed anyway, so it doesn't matter what the flags are for the event.
This commit is contained in:
Aaron Piotrowski 2017-02-16 23:39:11 -06:00
parent 9073f6c999
commit bb51720818

View File

@ -138,14 +138,10 @@ class EventLoop extends Loop {
case Watcher::DELAY:
case Watcher::REPEAT:
$flags = \Event::TIMEOUT;
if ($watcher->type === Watcher::REPEAT) {
$flags |= \Event::PERSIST;
}
$this->events[$id] = new \Event(
$this->handle,
-1,
$flags,
\Event::TIMEOUT | \Event::PERSIST,
$this->timerCallback,
$watcher
);