think\exception\ErrorException: Swoole\Timer::after(): Timer must be greater than or equal to 1 in /www/wwwroot/xxxxx.com/vendor/workerman/workerman/Events/Swoole.php:76
Swoole\Timer::after最小時(shí)間不能為0吧
打印下,看下Swoole\Timer::after() 傳入的參數(shù)是什么
[2021-03-05T11:13:00+08:00][ info ] {"fd":60,"flag":16,"func":{},"args":[]}
0
[2021-03-05T11:13:00+08:00][ info ] {"fd":1.0e-6,"flag":16,"func":{},"args":[]}
0
[2021-03-05T11:13:00+08:00][ info ] {"fd":1.0e-6,"flag":16,"func":{},"args":[]}
0
[2021-03-05T11:13:00+08:00][ info ] {"fd":1.0e-6,"flag":16,"func":{},"args":[]}
0
[2021-03-05T11:13:00+08:00][ info ] {"fd":60,"flag":16,"func":{},"args":[]}
有個(gè)fd為1.0e-6,按照代碼里寫(xiě)的*1000后為0.01,就報(bào)錯(cuò)了,Swoole\Timer::after()的時(shí)間指本來(lái)就是毫秒了,但卻傳了一個(gè)0.01,那不是workerman/workerman/Events/Swoole.php的問(wèn)題,而是workerman/crontab那邊時(shí)間轉(zhuǎn)換傳遞的值不對(duì)吧?
在\Workerman\Crontab\Crontab 162行
Timer::add($t*1000, $cb, null, false);
在這里加入*1000就正常了(只針對(duì)Swoole),應(yīng)該不是規(guī)范的解決方案,還望作者修正。
在\Workerman\Crontab\Crontab 162行
Timer::add($t*1000, $cb, null, false);
在這里加入*1000就正常了(只針對(duì)Swoole),應(yīng)該不是規(guī)范的解決方案,還望作者修正。
\Workerman\RedisQueue\Client 239行也存在這個(gè)問(wèn)題,需要對(duì)Swoole環(huán)境下*1000