소스 검색

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