mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-25 15:55:22 +00:00
Update ApiV1Controller, invalidate status reply cache on new reply
This commit is contained in:
parent
3d86d21be6
commit
3c261bbfec
1 changed files with 8 additions and 0 deletions
|
@ -2110,6 +2110,7 @@ class ApiV1Controller extends Controller
|
||||||
$status->in_reply_to_profile_id = $parent->profile_id;
|
$status->in_reply_to_profile_id = $parent->profile_id;
|
||||||
$status->save();
|
$status->save();
|
||||||
StatusService::del($parent->id);
|
StatusService::del($parent->id);
|
||||||
|
Cache::forget('status:replies:all:' . $parent->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($ids) {
|
if($ids) {
|
||||||
|
@ -2519,6 +2520,13 @@ class ApiV1Controller extends Controller
|
||||||
|
|
||||||
$sortBy = $request->input('sort', 'all');
|
$sortBy = $request->input('sort', 'all');
|
||||||
|
|
||||||
|
if($sortBy == 'all' && $status['replies_count'] && $request->has('refresh_cache')) {
|
||||||
|
if(!Cache::has('status:replies:all-rc:' . $id)) {
|
||||||
|
Cache::forget('status:replies:all:' . $id);
|
||||||
|
Cache::put('status:replies:all-rc:' . $id, true, 300);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if($sortBy == 'all' && !$request->has('cursor')) {
|
if($sortBy == 'all' && !$request->has('cursor')) {
|
||||||
$ids = Cache::remember('status:replies:all:' . $id, 86400, function() use($id) {
|
$ids = Cache::remember('status:replies:all:' . $id, 86400, function() use($id) {
|
||||||
return DB::table('statuses')
|
return DB::table('statuses')
|
||||||
|
|
Loading…
Reference in a new issue