mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 14:31:26 +00:00
Update FederationController
This commit is contained in:
parent
01fd26a296
commit
93c9ce2ff4
1 changed files with 6 additions and 6 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue