From 0975726abf11e7ac89b3aef1a80727ce15f74822 Mon Sep 17 00:00:00 2001 From: Richard Fath Date: Sun, 16 Jan 2022 17:42:10 +0100 Subject: [PATCH] Revert use DateInterval --- administrator/components/com_scheduler/src/Task/Task.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/administrator/components/com_scheduler/src/Task/Task.php b/administrator/components/com_scheduler/src/Task/Task.php index fbfc5686fbf..fdc0b3e9872 100644 --- a/administrator/components/com_scheduler/src/Task/Task.php +++ b/administrator/components/com_scheduler/src/Task/Task.php @@ -12,7 +12,6 @@ // Restrict direct access \defined('_JEXEC') or die; -use DateInterval; use Joomla\CMS\Application\CMSApplication; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Event\AbstractEvent; @@ -266,7 +265,7 @@ public function run(): bool * Moreover, the times executed does NOT increase for each step. It will increase once, * after the last step, when they return Status::OK. */ - $this->set('next_execution', Factory::getDate('now', 'UTC')->sub(new DateInterval('PT1M'))->toSql()); + $this->set('next_execution', Factory::getDate('now', 'UTC')->sub(new \DateInterval('PT1M'))->toSql()); } // The only acceptable "successful" statuses are either clean exit or resuming execution. @@ -322,7 +321,7 @@ public function acquireLock(): bool $now = Factory::getDate('now', 'GMT'); $timeout = ComponentHelper::getParams('com_scheduler')->get('timeout', 300); - $timeout = new DateInterval(sprintf('PT%dS', $timeout)); + $timeout = new \DateInterval(sprintf('PT%dS', $timeout)); $timeoutThreshold = (clone $now)->sub($timeout)->toSql(); $now = $now->toSql();