Use CronHelper service in cron workers [MAILPOET-2459]

This commit is contained in:
wxa
2019-10-30 16:26:38 +03:00
committed by Jack Kitterhing
parent 3436fed6e7
commit 81caa04479
14 changed files with 131 additions and 60 deletions

View File

@ -55,10 +55,10 @@ class InactiveSubscribers extends SimpleWorker {
$last_subscriber_id += self::BATCH_SIZE;
$task->meta = ['last_subscriber_id' => $last_subscriber_id];
$task->save();
CronHelper::enforceExecutionLimit($this->timer);
$this->cron_helper->enforceExecutionLimit($this->timer);
};
while ($this->inactive_subscribers_controller->markActiveSubscribers($days_to_inactive, self::BATCH_SIZE) === self::BATCH_SIZE) {
CronHelper::enforceExecutionLimit($this->timer);
$this->cron_helper->enforceExecutionLimit($this->timer);
};
self::schedule();
return true;