diff options
| author | winter | 2025-05-11 18:24:02 +0100 |
|---|---|---|
| committer | winter | 2025-05-11 18:24:02 +0100 |
| commit | 5d7a4605bd0bd71949a37139eccfbf8a70d0c32e (patch) | |
| tree | 505324e8aa1478776f7ea41015e426a15b795f79 /Digitigrade/Job | |
| parent | 5f5a1323eda22d7771ec10c364d41650d7f2814f (diff) | |
improvements to simple remote actor support
Diffstat (limited to 'Digitigrade/Job')
| -rw-r--r-- | Digitigrade/Job/PeriodicFetchRemoteFeed.php | 14 |
1 files changed, 9 insertions, 5 deletions
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 |
