Catch mySqlGoneAway error from originated from MailPoet crons
MAILPOET-6020
This commit is contained in:
committed by
Aschepikov
parent
988dec3e66
commit
81f29a61ac
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace MailPoet\Cron\ActionScheduler;
|
||||
|
||||
use MailPoet\Util\Helpers;
|
||||
use MailPoet\WP\Functions as WPFunctions;
|
||||
|
||||
class RemoteExecutorHandler {
|
||||
@@ -41,9 +42,17 @@ class RemoteExecutorHandler {
|
||||
}
|
||||
|
||||
public function runActionScheduler(): void {
|
||||
$this->wp->addFilter('action_scheduler_queue_runner_concurrent_batches', [$this, 'ensureConcurrency']);
|
||||
\ActionScheduler_QueueRunner::instance()->run();
|
||||
wp_die();
|
||||
try {
|
||||
$this->wp->addFilter('action_scheduler_queue_runner_concurrent_batches', [$this, 'ensureConcurrency']);
|
||||
\ActionScheduler_QueueRunner::instance()->run();
|
||||
wp_die();
|
||||
} catch (\Exception $e) {
|
||||
$mySqlGoneAwayMessage = Helpers::mySqlGoneAwayExceptionHandler($e);
|
||||
if ($mySqlGoneAwayMessage) {
|
||||
throw new \Exception($mySqlGoneAwayMessage, 0, $e);
|
||||
}
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user