Merge pull request #3136 from pixelfed/staging

Update CommentPipeline
This commit is contained in:
daniel 2022-01-08 05:02:26 -07:00 committed by GitHub
commit 94df59ed1f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 2 deletions

View file

@ -2516,7 +2516,7 @@ class ApiV1Controller extends Controller
$sortBy = $request->input('sort', 'all');
if($sortBy == 'all' && !$request->has('cursor')) {
$ids = Cache::remember('status:replies:all:' . $id, 900, function() use($id) {
$ids = Cache::remember('status:replies:all:' . $id, 86400, function() use($id) {
return DB::table('statuses')
->where('in_reply_to_id', $id)
->orderBy('id')

View file

@ -93,5 +93,14 @@ class CommentPipeline implements ShouldQueue
NotificationService::set($notification->profile_id, $notification->id);
StatusService::del($comment->id);
});
if($exists = Cache::get('status:replies:all:' . $status->id)) {
if($exists && $exists->count() == 3) {
} else {
Cache::forget('status:replies:all:' . $status->id);
}
} else {
Cache::forget('status:replies:all:' . $status->id);
}
}
}