]> git.mxchange.org Git - friendica.git/commitdiff
Possibly fixes 5137: Only execute "optimize table" when allowed
authorMichael <heluecht@pirati.ca>
Sun, 27 May 2018 06:23:18 +0000 (06:23 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 27 May 2018 06:23:18 +0000 (06:23 +0000)
src/Worker/Cron.php

index b0337e7db5abeaed672cfa55871e53952817f3df..e425c03508330c88a78bfb5cde83bd360e6f4553 100644 (file)
@@ -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());
                }