mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-26 08:13:16 +00:00
Update CommentPipeline, remove expensive reply count re-calculation query
This commit is contained in:
parent
e27d1a4424
commit
b457a44683
1 changed files with 0 additions and 8 deletions
|
@ -59,14 +59,6 @@ class CommentPipeline implements ShouldQueue
|
|||
$target = $status->profile;
|
||||
$actor = $comment->profile;
|
||||
|
||||
if(config('database.default') === 'mysql') {
|
||||
DB::transaction(function() use($status) {
|
||||
$count = DB::select( DB::raw("select id, in_reply_to_id from statuses, (select @pv := :kid) initialisation where id > @pv and find_in_set(in_reply_to_id, @pv) > 0 and @pv := concat(@pv, ',', id)"), [ 'kid' => $status->id]);
|
||||
$status->reply_count = count($count);
|
||||
$status->save();
|
||||
});
|
||||
}
|
||||
|
||||
if ($actor->id === $target->id || $status->comments_disabled == true) {
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue