Skip to content

Commit

Permalink
Update StatusReplyPipeline, remove expensive reply count re-calculati…
Browse files Browse the repository at this point in the history
…on query
  • Loading branch information
dansup committed Dec 20, 2022
1 parent 06c1040 commit a2f8aad
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions app/Jobs/StatusPipeline/StatusReplyPipeline.php
Expand Up @@ -68,14 +68,6 @@ public function handle()
return 1;
}

if(config('database.default') === 'mysql') {
DB::transaction(function() use($reply) {
$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->save();
});
}

DB::transaction(function() use($target, $actor, $status) {
$notification = new Notification();
$notification->profile_id = $target->id;
Expand Down

0 comments on commit a2f8aad

Please sign in to comment.