From acba2816e295e03388c8959c855aa94aad8721b1 Mon Sep 17 00:00:00 2001 From: ghost Date: Tue, 13 Jun 2023 17:45:02 +0300 Subject: [PATCH] remove transaction from tables optimization case --- crontab/cleaner.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/crontab/cleaner.php b/crontab/cleaner.php index 53ef8f8..d736f77 100644 --- a/crontab/cleaner.php +++ b/crontab/cleaner.php @@ -41,9 +41,9 @@ $logsCleanerDeleted = 0; $logsCrawlerDeleted = 0; // Begin update -try { +$db->beginTransaction(); - $db->beginTransaction(); +try { // Get cleaner queue foreach ($db->getCleanerQueue(CLEAN_HOST_LIMIT, time() - CLEAN_HOST_SECONDS_OFFSET) as $host) { @@ -239,16 +239,10 @@ if (CLEAN_DB_TABLES_OPTIMIZATION) { try { - $db->beginTransaction(); - $db->optimize(); - $db->commit(); - } catch (Exception $e) { - $db->rollBack(); - var_dump($e); } }