浏览代码

Update Swoole.php

walkor 4 年之前
父节点
当前提交
a1e0cca191
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      Events/Swoole.php

+ 5 - 1
Events/Swoole.php

@@ -61,7 +61,11 @@ class Swoole implements EventInterface
                     $this->mapId = 0;
                 }
                 $mapId = $this->mapId++;
-                $timer_id = Timer::$method($fd * 1000,
+                $t = (int)($fd * 1000);
+                if ($t < 1) {
+                   $t = 1;   
+                }
+                $timer_id = Timer::$method($t,
                     function ($timer_id = null) use ($func, $args, $mapId) {
                         \call_user_func_array($func, $args);
                         // EV_TIMER_ONCE