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

@ -691,7 +691,7 @@ class PublicApiController extends Controller
public function accountFollowing(Request $request, $id)
{
abort_if(!$request->user(), 403);
abort_if(!$request->user(), 403);
$account = AccountService::get($id);
abort_if(!$account, 404);
$pid = $request->user()->profile_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);
}
}
}