From 93c9ce2ff457803a04aa5382ba9d61edc321f6db Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 15 Jul 2019 19:15:30 -0600 Subject: [PATCH] Update FederationController --- app/Http/Controllers/FederationController.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/Http/Controllers/FederationController.php b/app/Http/Controllers/FederationController.php index f4c162ca3..743b27688 100644 --- a/app/Http/Controllers/FederationController.php +++ b/app/Http/Controllers/FederationController.php @@ -98,20 +98,20 @@ class FederationController extends Controller abort_if(!config('federation.nodeinfo.enabled'), 404); $res = Cache::remember('api:nodeinfo', now()->addMinutes(15), function () { - $activeHalfYear = Cache::remember('api:nodeinfo:ahy', now()->addHours(12), function() { + $activeHalfYear = Cache::remember('api:nodeinfo:ahy', now()->addHours(6), function() { $count = collect([]); - // $likes = Like::select('profile_id')->where('created_at', '>', now()->subMonths(6)->toDateTimeString())->groupBy('profile_id')->pluck('profile_id')->toArray(); - // $count = $count->merge($likes); + $likes = Like::select('profile_id')->where('created_at', '>', now()->subMonths(6)->toDateTimeString())->groupBy('profile_id')->pluck('profile_id')->toArray(); + $count = $count->merge($likes); $statuses = Status::select('profile_id')->whereLocal(true)->where('created_at', '>', now()->subMonths(6)->toDateTimeString())->groupBy('profile_id')->pluck('profile_id')->toArray(); $count = $count->merge($statuses); $profiles = Profile::select('id')->whereNull('domain')->where('created_at', '>', now()->subMonths(6)->toDateTimeString())->groupBy('id')->pluck('id')->toArray(); $count = $count->merge($profiles); return $count->unique()->count(); }); - $activeMonth = Cache::remember('api:nodeinfo:am', now()->addHours(12), function() { + $activeMonth = Cache::remember('api:nodeinfo:am', now()->addHours(6), function() { $count = collect([]); - // $likes = Like::select('profile_id')->where('created_at', '>', now()->subMonths(1)->toDateTimeString())->groupBy('profile_id')->pluck('profile_id')->toArray(); - // $count = $count->merge($likes); + $likes = Like::select('profile_id')->where('created_at', '>', now()->subMonths(1)->toDateTimeString())->groupBy('profile_id')->pluck('profile_id')->toArray(); + $count = $count->merge($likes); $statuses = Status::select('profile_id')->whereLocal(true)->where('created_at', '>', now()->subMonths(1)->toDateTimeString())->groupBy('profile_id')->pluck('profile_id')->toArray(); $count = $count->merge($statuses); $profiles = Profile::select('id')->whereNull('domain')->where('created_at', '>', now()->subMonths(1)->toDateTimeString())->groupBy('id')->pluck('id')->toArray();