From db254986ee0b2fd1d5f237aea2aa719448f2d94c Mon Sep 17 00:00:00 2001 From: Rostislav Wolny Date: Tue, 2 Aug 2022 13:26:52 +0200 Subject: [PATCH] Fix initial trigger scheduling When scheduling using timestamp the action scheduler uses default UTC timezone See https://github.com/woocommerce/action-scheduler/blob/0a294e6df6ad74f40a8293c0d9e016451a21c4d5/functions.php#L330-L339 [MAILPOET-4274] --- mailpoet/lib/Cron/ActionScheduler/Actions/DaemonTrigger.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mailpoet/lib/Cron/ActionScheduler/Actions/DaemonTrigger.php b/mailpoet/lib/Cron/ActionScheduler/Actions/DaemonTrigger.php index 09961ce035..1ae342569b 100644 --- a/mailpoet/lib/Cron/ActionScheduler/Actions/DaemonTrigger.php +++ b/mailpoet/lib/Cron/ActionScheduler/Actions/DaemonTrigger.php @@ -37,7 +37,7 @@ class DaemonTrigger { public function init() { $this->wp->addAction(self::NAME, [$this, 'process']); if (!$this->actionScheduler->hasScheduledAction(self::NAME)) { - $this->actionScheduler->scheduleRecurringAction($this->wp->currentTime('timestamp'), 20, self::NAME); + $this->actionScheduler->scheduleRecurringAction($this->wp->currentTime('timestamp', true), 20, self::NAME); } } @@ -55,7 +55,7 @@ class DaemonTrigger { return; } // Start recurring action with minimal interval to ensure continuous execution of the daemon - $this->actionScheduler->scheduleRecurringAction($this->wp->currentTime('timestamp') - 1, 1, DaemonRun::NAME); + $this->actionScheduler->scheduleRecurringAction($this->wp->currentTime('timestamp', true) - 1, 1, DaemonRun::NAME); $this->remoteExecutorHandler->triggerExecutor(); } }