mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-26 00:03:16 +00:00
Update ReplyPipelines, use more efficent reply count calculation
This commit is contained in:
parent
e905fc2925
commit
d4dfa95c30
2 changed files with 2 additions and 4 deletions
|
@ -60,8 +60,7 @@ class CommentPipeline implements ShouldQueue
|
|||
$actor = $comment->profile;
|
||||
|
||||
if(config('database.default') === 'mysql') {
|
||||
$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->reply_count = $status->reply_count + 1;
|
||||
$status->save();
|
||||
}
|
||||
|
||||
|
|
|
@ -69,8 +69,7 @@ class StatusReplyPipeline implements ShouldQueue
|
|||
}
|
||||
|
||||
if(config('database.default') === 'mysql') {
|
||||
$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' => $reply->id]);
|
||||
$reply->reply_count = count($count);
|
||||
$reply->reply_count = $reply->reply_count + 1;
|
||||
$reply->save();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue