mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-25 01:25:34 +08:00
fix cron using closure bug
This commit is contained in:
@@ -78,7 +78,7 @@ class Schedule
|
|||||||
$this->executing[] = $cron;
|
$this->executing[] = $cron;
|
||||||
// 新建一个协程运行排程任务,避免阻塞
|
// 新建一个协程运行排程任务,避免阻塞
|
||||||
Adaptive::getCoroutine()->create(function () use ($cron) {
|
Adaptive::getCoroutine()->create(function () use ($cron) {
|
||||||
$callable = [$cron->class, $cron->method];
|
$callable = $cron->class === '' ? $cron->method : [$cron->class, $cron->method];
|
||||||
container()->call($callable);
|
container()->call($callable);
|
||||||
$this->executing = array_diff($this->executing, [$cron]);
|
$this->executing = array_diff($this->executing, [$cron]);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user