diff options
author | diosmosis <benaka@piwik.pro> | 2015-03-04 03:39:48 +0300 |
---|---|---|
committer | diosmosis <benaka@piwik.pro> | 2015-03-04 03:39:48 +0300 |
commit | b78eee41f23961c5ba81fbad19f7d885348711f7 (patch) | |
tree | e24dfccd839e9e5c9f7d1ba910fa6bd580e8607e | |
parent | b60b66faf588d2eac10ff79fb7ca5011e299c52d (diff) |
Refs #7181, remove 'purging every N hours' check in archive purger logic since it appears unnecessary. Removing for 2.11.2 release.
-rw-r--r-- | core/ArchiveProcessor/Rules.php | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/core/ArchiveProcessor/Rules.php b/core/ArchiveProcessor/Rules.php index a715623ca6..06b38aa27d 100644 --- a/core/ArchiveProcessor/Rules.php +++ b/core/ArchiveProcessor/Rules.php @@ -124,30 +124,15 @@ class Rules */ public static function shouldPurgeOutdatedArchives(Date $date) { - if (! self::isRequestAuthorizedToArchive()){ - Log::info("Purging temporary archives: skipped (no authorization)"); - return false; - } - - $key = self::FLAG_TABLE_PURGED . "blob_" . $date->toString('Y_m'); - $timestamp = Option::get($key); - - // we shall purge temporary archives after their timeout is finished, plus an extra 6 hours - // in case archiving is disabled or run once a day, we give it this extra time to run - // and re-process more recent records... - $temporaryArchivingTimeout = self::getTodayArchiveTimeToLive(); - $hoursBetweenPurge = 6; - $purgeEveryNSeconds = max($temporaryArchivingTimeout, $hoursBetweenPurge * 3600); - // we only delete archives if we are able to process them, otherwise, the browser might process reports // when &segment= is specified (or custom date range) and would below, delete temporary archives that the // browser is not able to process until next cron run (which could be more than 1 hour away) - if ($timestamp !== false && $timestamp >= time() - $purgeEveryNSeconds) { - Log::info("Purging temporary archives: skipped (purging every " . $hoursBetweenPurge . "hours)"); + if (! self::isRequestAuthorizedToArchive()){ + Log::info("Purging temporary archives: skipped (no authorization)"); return false; } - Option::set($key, time()); + $temporaryArchivingTimeout = self::getTodayArchiveTimeToLive(); if (self::isBrowserTriggerEnabled()) { // If Browser Archiving is enabled, it is likely there are many more temporary archives |