Skip to content

Commit

Permalink
Merge pull request #3 from richard67/4.1-dev-nikosdion-feature-task-r…
Browse files Browse the repository at this point in the history
…esumable-mod-1

[CMS PR 36708] Revert use DateInterval
  • Loading branch information
Nicholas K. Dionysopoulos authored Jan 16, 2022
2 parents 4a39d60 + 0975726 commit 9962baf
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions administrator/components/com_scheduler/src/Task/Task.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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();

Expand Down

0 comments on commit 9962baf

Please sign in to comment.