leted = $worker->processTaskStrategy($task, $this->timer); } catch (\Exception $e) { $this->stopProgress($task); throw $e; } if ($completed) { $this->complete($task); } $this->stopProgress($task); return (bool)$completed; } private function rescheduleOutdated(ScheduledTaskEntity $task) { $currentTime = Carbon::createFromTimestamp($this->wp->currentTime('timestamp')); if (empty($task->getUpdatedAt())) { // missing updatedAt, consider this task outdated (set year to 2000) and reschedule $updatedAt = Carbon::createFromDate(2000); } else if (!$task->getUpdatedAt() instanceof Carbon) { $updatedAt = new Carbon($task->getUpdatedAt()); } else { $updatedAt = $task->getUpdatedAt(); } // If the task is running for too long consider it stuck and reschedule if (!empty($task->getUpdatedAt()) && $updatedAt->diffInMinutes($currentTime, false) > self::TASK_RUN_TIMEOUT) { $this->stopProgress($task); $this->cronWorkerScheduler->reschedule($task, self::TIMED_OUT_TASK_RESCHEDULE_TIMEOUT); return true; } return false; } private function isInProgress(ScheduledTaskEntity $task) { if ($task->getInProgress()) { // Do not run multiple instances of the task return true; } return false; } private function startProgress(ScheduledTaskEntity $task) { $task->setInProgress(true); $this->scheduledTasksRepository->persist($task); $this->scheduledTasksRepository->flush(); } private function stopProgress(ScheduledTaskEntity $task) { $task->setInProgress(false); $this->scheduledTasksRepository->persist($task); $this->scheduledTasksRepository->flush(); } private function complete(ScheduledTaskEntity $task) { $task->setProcessedAt(Carbon::createFromTimestamp($this->wp->currentTime('timestamp'))); $task->setStatus(ScheduledTaskEntity::STATUS_COMPLETED); $this->scheduledTasksRepository->persist($task); $this->scheduledTasksRepository->flush(); } }
Fatal error: Uncaught Error: Class "MailPoet\Cron\CronWorkerRunner" not found in /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php:2436 Stack trace: #0 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2456): MailPoetGenerated\FreeCachedContainer->getCronWorkerRunnerService() #1 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2386): MailPoetGenerated\FreeCachedContainer->getDaemonService() #2 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2466): MailPoetGenerated\FreeCachedContainer->getDaemonRunService() #3 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2426): MailPoetGenerated\FreeCachedContainer->getDaemonActionSchedulerRunnerService() #4 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2276): MailPoetGenerated\FreeCachedContainer->getCronTriggerService() #5 /htdocs/wp-content/plugins/mailpoet/vendor-prefixed/symfony/dependency-injection/Container.php(122): MailPoetGenerated\FreeCachedContainer->getInitializerService() #6 /htdocs/wp-content/plugins/mailpoet/vendor-prefixed/symfony/dependency-injection/Container.php(110): MailPoetVendor\Symfony\Component\DependencyInjection\Container->make('MailPoet\\Config...', 1) #7 /htdocs/wp-content/plugins/mailpoet/lib/DI/ContainerWrapper.php(39): MailPoetVendor\Symfony\Component\DependencyInjection\Container->get('MailPoet\\Config...') #8 /htdocs/wp-content/plugins/mailpoet/mailpoet_initializer.php(89): MailPoet\DI\ContainerWrapper->get('MailPoet\\Config...') #9 /htdocs/wp-content/plugins/mailpoet/mailpoet.php(206): require_once('/htdocs/wp-cont...') #10 /htdocs/wp-settings.php(462): include_once('/htdocs/wp-cont...') #11 /htdocs/wp-config.php(96): require_once('/htdocs/wp-sett...') #12 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #13 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #14 /htdocs/index.php(17): require('/htdocs/wp-blog...') #15 {main} thrown in /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php on line 2436