diff options
Diffstat (limited to 'Digitigrade')
| -rw-r--r-- | Digitigrade/Job/PeriodicFetchRemoteFeed.php | 14 | ||||
| -rw-r--r-- | Digitigrade/Model/Actor.php | 2 |
2 files changed, 10 insertions, 6 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 diff --git a/Digitigrade/Model/Actor.php b/Digitigrade/Model/Actor.php index 3fb7e4e..a8909df 100644 --- a/Digitigrade/Model/Actor.php +++ b/Digitigrade/Model/Actor.php @@ -259,7 +259,7 @@ class Actor extends PushableModel implements RpcReceiver { if (!$target->isLocal && !isset($target->endpoints->follow, $target->endpoints->unfollow)) { // if this is the first time someone local followed this actor, put a job in to update them if (count(array_filter($target->findFollowers(), fn(Actor $a) => $a->isLocal)) == 0) { - (new PeriodicFetchRemoteFeed($target))->submit(); + (new PeriodicFetchRemoteFeed($target))->submit(now: true); } FollowRelation::create($this, $target, FollowRelationStatus::ACTIVE); // no need to processNotifications because it's always going to be a remote user & not pending |
