From 87369d84d455a82d6cf38000162949c34a57d629 Mon Sep 17 00:00:00 2001 From: Shish Date: Thu, 12 Dec 2024 18:02:46 +0000 Subject: [PATCH] [numeric_score] expect deleting all votes to take a long time --- ext/numeric_score/main.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/numeric_score/main.php b/ext/numeric_score/main.php index 52b442262..a69bbaabf 100644 --- a/ext/numeric_score/main.php +++ b/ext/numeric_score/main.php @@ -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.")",