修改,重啟任務(wù),均無效,甚至restart項(xiàng)目也不行,它也會(huì)定期執(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還是類都有這個(gè)情況,明明任務(wù)已經(jīng)設(shè)置開啟和重復(fù),但是不執(zhí)行
上面跳過的這個(gè),甚至都沒有修改任務(wù),僅僅是因?yàn)閳?bào)錯(cuò),重啟了restart了項(xiàng)目了,就出現(xiàn)這個(gè)了。
好像每次都是因?yàn)橹貑⒘隧?xiàng)目就出現(xiàn)這個(gè)了
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;
}
}
任務(wù)中目前沒有寫邏輯,只寫了一個(gè)日志
更新到1.41后,可以執(zhí)行了,但是仍然報(bào)錯(cuò)
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
我把任務(wù)寫成了命令行,可以了。但是類的問題可能還未解決。另外升級1.41后,修改任務(wù)的時(shí)候又報(bào)錯(cuò)了,1.4的時(shí)候還沒事。
[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()
剛開始的時(shí)候,是可以執(zhí)行的,但是出現(xiàn)了這個(gè)報(bào)錯(cuò)
PHP Fatal error: Cannot declare class app\common\crontab\UpdateCity, because the name is already in use
更新到1.41后,可以執(zhí)行了,但是仍然報(bào)錯(cuò)
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