修改,重啟任務,均無效,甚至restart項目也不行,它也會定期執(zhí)行,但是每次都是skipped execution
worker:0 [2023-02-16 09:53:29] Crontab task [更新城市] skipped execution at 2023-02-16 09:53:29. [Ok]
worker:0 [2023-02-16 09:54:26] Crontab task [更新城市] skipped execution at 2023-02-16 09:54:26. [Ok]
worker:0 [2023-02-16 09:57:02] Crontab task [更新城市] skipped execution at 2023-02-16 09:57:02
不管是命令,還是url還是類都有這個情況,明明任務已經(jīng)設置開啟和重復,但是不執(zhí)行
上面跳過的這個,甚至都沒有修改任務,僅僅是因為報錯,重啟了restart了項目了,就出現(xiàn)這個了。
好像每次都是因為重啟了項目就出現(xiàn)這個了
centos系統(tǒng),最新的webman,1.4版本的yzh52521/webman-task
<?php
namespace app\common\crontab;
use support\Log;
class UpdateCity
{
public function execute()
{
Log::channel('star')->info(date('Y-m-d H:i:s') . '執(zhí)行了更新城市');
return true;
}
}
任務中目前沒有寫邏輯,只寫了一個日志
更新到1.41后,可以執(zhí)行了,但是仍然報錯
PHP Fatal error: Cannot declare class app\common\crontab\UpdateCity, because the name is already in use in /www/wwwroot/yhs-web/app/common/crontab/UpdateCity.php on line 10
我把任務寫成了命令行,可以了。但是類的問題可能還未解決。另外升級1.41后,修改任務的時候又報錯了,1.4的時候還沒事。
[2023-02-16 11:37:34] default.ERROR: 172.17.0.1 POST 127.0.0.1:8787/app/admin/th-system-crontab/update
TypeError: json_decode() expects parameter 1 to be string, bool given in /www/wwwroot/yhs-web/vendor/yzh52521/webman-task/src/Client.php:33
Stack trace:
0 /www/wwwroot/yhs-web/vendor/yzh52521/webman-task/src/Client.php(33): json_decode()
剛開始的時候,是可以執(zhí)行的,但是出現(xiàn)了這個報錯
PHP Fatal error: Cannot declare class app\common\crontab\UpdateCity, because the name is already in use