Default PF_HOME_TIMELINE_CACHE to true, remove false code path

The home timeline cache-busting calls (Cache::forget) are now
unconditional since caching is always on. Removed the config
checks from StatusObserver, FollowerObserver, and UnfollowPipeline.
pull/6586/head
Your Name 3 months ago
parent 8d156bda1a
commit 986e271e98

@ -103,7 +103,7 @@ class UnfollowPipeline implements ShouldQueue
});
}
if ($actorProfile->domain == null && config('instance.timeline.home.cached')) {
if ($actorProfile->domain == null) {
Cache::forget('pf:timelines:home:'.$actor);
}

@ -16,9 +16,7 @@ class FollowerObserver
*/
public function created(Follower $follower)
{
if (config('instance.timeline.home.cached')) {
Cache::forget('pf:timelines:home:'.$follower->profile_id);
}
Cache::forget('pf:timelines:home:'.$follower->profile_id);
FollowerService::add($follower->profile_id, $follower->following_id);
FeedFollowPipeline::dispatch($follower->profile_id, $follower->following_id)->onQueue('follow');

@ -40,9 +40,7 @@ class StatusObserver
return;
}
if (config('instance.timeline.home.cached')) {
Cache::forget('pf:timelines:home:'.$status->profile_id);
}
Cache::forget('pf:timelines:home:'.$status->profile_id);
if (in_array($status->scope, ['public', 'unlisted']) && in_array($status->type, ['photo', 'photo:album', 'video'])) {
ProfileStatusService::add($status->profile_id, $status->id);
@ -60,9 +58,7 @@ class StatusObserver
return;
}
if (config('instance.timeline.home.cached')) {
Cache::forget('pf:timelines:home:'.$status->profile_id);
}
Cache::forget('pf:timelines:home:'.$status->profile_id);
ProfileStatusService::delete($status->profile_id, $status->id);

@ -25,7 +25,7 @@ return [
'timeline' => [
'home' => [
'cached' => env('PF_HOME_TIMELINE_CACHE', false),
'cached' => env('PF_HOME_TIMELINE_CACHE', true),
'cache_ttl' => env('PF_HOME_TIMELINE_CACHE_TTL', 86400),
'cache_dropoff' => env('PF_HOME_TIMELINE_CACHE_DROPOFF', 800),
],

Loading…
Cancel
Save