From 5d7a4605bd0bd71949a37139eccfbf8a70d0c32e Mon Sep 17 00:00:00 2001 From: winter Date: Sun, 11 May 2025 18:24:02 +0100 Subject: improvements to simple remote actor support --- Digitigrade/Job/PeriodicFetchRemoteFeed.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'Digitigrade/Job/PeriodicFetchRemoteFeed.php') diff --git a/Digitigrade/Job/PeriodicFetchRemoteFeed.php b/Digitigrade/Job/PeriodicFetchRemoteFeed.php index e84757f..c64446d 100644 --- a/Digitigrade/Job/PeriodicFetchRemoteFeed.php +++ b/Digitigrade/Job/PeriodicFetchRemoteFeed.php @@ -28,10 +28,14 @@ class PeriodicFetchRemoteFeed extends Job { } } - public function submit() { - JobQueue::getInstance()->submitDelayedUntil( - $this, - (new \DateTimeImmutable)->add(new \DateInterval(GlobalSettings::getInstance()->get('instance.feedUpdateInterval') ?? 'PT1H')) - ); + public function submit(bool $now = false) { + if ($now) { + JobQueue::getInstance()->submitUrgent($this); + } else { + JobQueue::getInstance()->submitDelayedUntil( + $this, + (new \DateTimeImmutable)->add(new \DateInterval(GlobalSettings::getInstance()->get('instance.feedUpdateInterval') ?? 'PT1H')) + ); + } } } \ No newline at end of file -- cgit v1.3