add database optimization settings

This commit is contained in:
ghost 2023-05-29 22:13:41 +03:00
parent fc687f7f2c
commit 45c4f7b7b0
2 changed files with 11 additions and 1 deletions

View File

@ -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); 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 // API settings

View File

@ -253,7 +253,10 @@ try {
$db->commit(); $db->commit();
// Optimize tables // Optimize tables
$db->optimize(); if (CLEAN_DB_TABLES_OPTIMIZATION) {
$db->optimize();
}
} catch(Exception $e) { } catch(Exception $e) {