Skip to content

Commit

Permalink
Merge pull request #941 from webrobot1/4.1
Browse files Browse the repository at this point in the history
fix by #923  discuss
  • Loading branch information
walkor authored Jul 17, 2023
2 parents c4d9f1e + 04be05e commit 7bea77e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Events/Uv.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ public function add($fd, $flag, $func, $args = null)
$repeat = $flag === self::EV_TIMER_ONCE ? 0 : (int)($fd * 1000);
$param = array($func, (array)$args, $flag, $fd, self::$_timerId);
$timerWatcher = \uv_timer_init();
\uv_timer_start($timerWatcher, 1, $repeat, function($watcher)use($param){
call_user_func_array([$this, 'timerCallback'], [$param]);
\uv_timer_start($timerWatcher, ($flag === self::EV_TIMER_ONCE ? (int)($fd * 1000) :1), $repeat, function($watcher)use($param){
call_user_func_array([$this, 'timerCallback'], [$param]);
});
$this->_eventTimer[self::$_timerId] = $timerWatcher;
return self::$_timerId++;
Expand Down

0 comments on commit 7bea77e

Please sign in to comment.