Move cron-scheduling logic from SimpleWorker to CronWorkerRunner

[MAILPOET-2539]
This commit is contained in:
Jan Jakeš
2019-11-25 13:36:12 +01:00
committed by Jack Kitterhing
parent acaaa9e2b2
commit b7294bd86c
6 changed files with 248 additions and 158 deletions

View File

@ -35,8 +35,10 @@ class Migration extends SimpleWorker {
($unmigrated_queues_count == 0
&& count($unmigrated_queue_subscribers) == 0)
) {
// nothing to migrate
$this->complete($task);
// nothing to migrate, complete task
$task->processed_at = WPFunctions::get()->currentTime('mysql');
$task->status = ScheduledTask::STATUS_COMPLETED;
$task->save();
$this->resumeSending();
return false;
}