|
|
|
@ -41,10 +41,10 @@ $logsCleanerDeleted = 0;
@@ -41,10 +41,10 @@ $logsCleanerDeleted = 0;
|
|
|
|
|
$logsCrawlerDeleted = 0; |
|
|
|
|
|
|
|
|
|
// Begin update |
|
|
|
|
$db->beginTransaction(); |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
$db->beginTransaction(); |
|
|
|
|
|
|
|
|
|
// Get cleaner queue |
|
|
|
|
foreach ($db->getCleanerQueue(CLEAN_HOST_LIMIT, time() - CLEAN_HOST_SECONDS_OFFSET) as $host) { |
|
|
|
|
|
|
|
|
@ -227,17 +227,30 @@ try {
@@ -227,17 +227,30 @@ try {
|
|
|
|
|
// Commit results |
|
|
|
|
$db->commit(); |
|
|
|
|
|
|
|
|
|
} catch (Exception $e) { |
|
|
|
|
|
|
|
|
|
$db->rollBack(); |
|
|
|
|
|
|
|
|
|
var_dump($e); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Optimize tables |
|
|
|
|
if (CLEAN_DB_TABLES_OPTIMIZATION) { |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
$db->beginTransaction(); |
|
|
|
|
|
|
|
|
|
$db->optimize(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} catch(Exception $e) { |
|
|
|
|
$db->commit(); |
|
|
|
|
|
|
|
|
|
var_dump($e); |
|
|
|
|
} catch (Exception $e) { |
|
|
|
|
|
|
|
|
|
$db->rollBack(); |
|
|
|
|
|
|
|
|
|
var_dump($e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Debug |
|
|
|
|