浏览代码

debug co::sleep

stanley-king 3 年之前
父节点
当前提交
c6d3ce7ac9
共有 1 个文件被更改,包括 19 次插入16 次删除
  1. 19 16
      rdispatcher/codispatcher.php

+ 19 - 16
rdispatcher/codispatcher.php

@@ -106,22 +106,25 @@ function ratio_update(&$quit)
     while (!$quit)
     while (!$quit)
     {
     {
         Log::record("ratio_update start calc quit =" . strbool($quit),Log::DEBUG);
         Log::record("ratio_update start calc quit =" . strbool($quit),Log::DEBUG);
-
-        for ($i = 0; $i < 61; $i++) {
-            $cur_time = time();
-            $time_sec = $cur_time;
-            $next_min = $time_sec - $time_sec % 60;
-
-            if($quit) break;
-            if($next_min > $cur_min && $time_sec % 60 == 3) {
-                $cur_min = $next_min;
-                break;
-            } else {
-                Log::record("ratio_update start sleep",Log::DEBUG);
-                Swoole\Coroutine::sleep(1);
-                Log::record("ratio_update end sleep",Log::DEBUG);
-            }
-        }
+        Log::record("ratio_update start sleep",Log::DEBUG);
+        Swoole\Coroutine::sleep(1);
+        Log::record("ratio_update end sleep",Log::DEBUG);
+
+//        for ($i = 0; $i < 61; $i++) {
+//            $cur_time = time();
+//            $time_sec = $cur_time;
+//            $next_min = $time_sec - $time_sec % 60;
+//
+//            if($quit) break;
+//            if($next_min > $cur_min && $time_sec % 60 == 3) {
+//                $cur_min = $next_min;
+//                break;
+//            } else {
+//                Log::record("ratio_update start sleep",Log::DEBUG);
+//                Swoole\Coroutine::sleep(1);
+//                Log::record("ratio_update end sleep",Log::DEBUG);
+//            }
+//        }