diff --git a/config/app.php.txt b/config/app.php.txt index b9bd33a..5f372e6 100644 --- a/config/app.php.txt +++ b/config/app.php.txt @@ -384,6 +384,13 @@ define('CLEAN_PAGE_BAN_SECONDS_OFFSET', 60*60*24*30); */ define('CLEAN_PAGE_DESCRIPTION_OFFSET', 60*60*24*30*12*10); +/* + * Run database tables optimization + * + * When enabled - may reduce disk space usage but requires enough of RAM + * + */ +define('CLEAN_DB_TABLES_OPTIMIZATION', true); // API settings diff --git a/crontab/cleaner.php b/crontab/cleaner.php index e2ac895..9e0f347 100644 --- a/crontab/cleaner.php +++ b/crontab/cleaner.php @@ -253,7 +253,10 @@ try { $db->commit(); // Optimize tables - $db->optimize(); + if (CLEAN_DB_TABLES_OPTIMIZATION) { + + $db->optimize(); + } } catch(Exception $e) {