Reschedule failing cron tasks progressively [MAILPOET-2181]

This commit is contained in:
wxa
2019-07-28 16:42:47 +03:00
committed by M. Shull
parent e1b8462254
commit 8b867a7b4f
9 changed files with 86 additions and 27 deletions

View File

@@ -8,8 +8,6 @@ use MailPoet\Services\Bridge;
if (!defined('ABSPATH')) exit;
abstract class KeyCheckWorker extends SimpleWorker {
const UNAVAILABLE_SERVICE_RESCHEDULE_TIMEOUT = 60;
public $bridge;
function init() {
@@ -26,7 +24,7 @@ abstract class KeyCheckWorker extends SimpleWorker {
}
if (empty($result['code']) || $result['code'] == Bridge::CHECK_ERROR_UNAVAILABLE) {
$this->reschedule($task, self::UNAVAILABLE_SERVICE_RESCHEDULE_TIMEOUT);
$task->rescheduleProgressively();
return false;
}