mirror of
https://github.com/YGGverse/YGGo.git
synced 2025-02-03 10:25:52 +00:00
add tables optimization to the cron/cleaner task
This commit is contained in:
parent
134b70e130
commit
50c9066f62
@ -189,9 +189,13 @@ try {
|
||||
$logsCleanerDeleted += $db->deleteLogCleaner(time() - CLEAN_LOG_SECONDS_OFFSET);
|
||||
$logsCrawlerDeleted += $db->deleteLogCrawler(time() - CRAWL_LOG_SECONDS_OFFSET);
|
||||
|
||||
// Commit results
|
||||
$db->commit();
|
||||
|
||||
} catch(Exception $e){
|
||||
// Optimize tables
|
||||
$db->optimize();
|
||||
|
||||
} catch(Exception $e) {
|
||||
|
||||
var_dump($e);
|
||||
|
||||
|
@ -629,4 +629,18 @@ class MySQL {
|
||||
|
||||
return $query->rowCount();
|
||||
}
|
||||
|
||||
public function optimize() {
|
||||
|
||||
$this->_db->query('OPTIMIZE TABLE `host`');
|
||||
$this->_db->query('OPTIMIZE TABLE `hostPage`');
|
||||
$this->_db->query('OPTIMIZE TABLE `hostPageDescription`');
|
||||
$this->_db->query('OPTIMIZE TABLE `hostPageSnap`');
|
||||
$this->_db->query('OPTIMIZE TABLE `hostPageToHostPage`');
|
||||
|
||||
$this->_db->query('OPTIMIZE TABLE `logCleaner`');
|
||||
$this->_db->query('OPTIMIZE TABLE `logCrawler`');
|
||||
|
||||
$this->_db->query('OPTIMIZE TABLE `manifest`');
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user