From 9f901d65c9c96fcbcd9b856f74ca216d0b058c0d Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Tue, 23 May 2023 01:29:22 -0600 Subject: [PATCH 1/2] Update PublicTimelineService, improve warmCache query --- app/Services/PublicTimelineService.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Services/PublicTimelineService.php b/app/Services/PublicTimelineService.php index 75317aa80..2c9fbc7e3 100644 --- a/app/Services/PublicTimelineService.php +++ b/app/Services/PublicTimelineService.php @@ -77,12 +77,12 @@ class PublicTimelineService { if(self::count() == 0 || $force == true) { $hideNsfw = config('instance.hide_nsfw_on_public_feeds'); Redis::del(self::CACHE_KEY); - $ids = Status::whereNull('uri') - ->whereNull('in_reply_to_id') + $minId = SnowflakeService::byDate(now()->subDays(14)); + $ids = Status::where('id', '>', $minId) + ->whereNull(['uri', 'in_reply_to_id', 'reblog_of_id']) ->when($hideNsfw, function($q, $hideNsfw) { return $q->where('is_nsfw', false); }) - ->whereNull('reblog_of_id') ->whereIn('type', ['photo', 'photo:album', 'video', 'video:album', 'photo:video:album']) ->whereScope('public') ->orderByDesc('id') From 361d5f03745a60de4e3379c86eaf5da94863a71c Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Tue, 23 May 2023 01:30:29 -0600 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 475c4fdc4..55050e5d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,6 +51,7 @@ - Update scheduler, fix S3 media garbage collection not being executed when cloud storage is enabled via dashboard without .env/config being enabled ([adb070f1](https://github.com/pixelfed/pixelfed/commit/adb070f1)) - Update MediaController, add fallback for local files that are later stored on S3 but still are referenced in cached objects remotely ([4973cb46](https://github.com/pixelfed/pixelfed/commit/4973cb46)) - ([](https://github.com/pixelfed/pixelfed/commit/)) +- Update PublicTimelineService, improve warmCache query ([9f901d65](https://github.com/pixelfed/pixelfed/commit/9f901d65)) ## [v0.11.6 (2023-05-03)](https://github.com/pixelfed/pixelfed/compare/v0.11.5...v0.11.6)