From: Michael Date: Sun, 27 May 2018 06:23:18 +0000 (+0000) Subject: Possibly fixes 5137: Only execute "optimize table" when allowed X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=04fd6eff010a549cb4b1d4523246e7083cefe17f;p=friendica.git Possibly fixes 5137: Only execute "optimize table" when allowed --- diff --git a/src/Worker/Cron.php b/src/Worker/Cron.php index b0337e7db5..e425c03508 100644 --- a/src/Worker/Cron.php +++ b/src/Worker/Cron.php @@ -102,7 +102,9 @@ Class Cron { dba::delete('workerqueue', ['`done` AND `executed` < UTC_TIMESTAMP() - INTERVAL 1 HOUR']); // Optimizing this table only last seconds - dba::e("OPTIMIZE TABLE `workerqueue`"); + if (Config::get('system', 'optimize_workerqueue', false)) { + dba::e("OPTIMIZE TABLE `workerqueue`"); + } Config::set('system', 'last_cron_hourly', time()); }