Skip to content

Commit

Permalink
[numeric_score] expect deleting all votes to take a long time
Browse files Browse the repository at this point in the history
  • Loading branch information
shish committed Dec 12, 2024
1 parent 3815104 commit 87369d8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ext/numeric_score/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,8 @@ public function delete_votes_by(int $user_id): void

// vote recounting is pretty heavy, and often hits statement timeouts
// if you try to recount all the images in one go
foreach (array_chunk($image_ids, 20) as $chunk) {
shm_set_timeout(null);
foreach (array_chunk($image_ids, 100) as $chunk) {
$id_list = implode(",", $chunk);
$database->execute(
"DELETE FROM numeric_score_votes WHERE user_id=:user_id AND image_id IN (".$id_list.")",
Expand Down

0 comments on commit 87369d8

Please sign in to comment.