Skip to content

Commit

Permalink
Fixes #4382, purge outdated archives after current archive is finalized.
Browse files Browse the repository at this point in the history
  • Loading branch information
diosmosis committed Dec 20, 2013
1 parent 178bc36 commit 6980299
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
7 changes: 6 additions & 1 deletion core/ArchiveProcessor/Loader.php
Expand Up @@ -120,7 +120,12 @@ protected function prepareAllPluginsArchive($visits, $visitsConverted)
$pluginsArchiver->callAggregateAllPlugins($visits, $visitsConverted);
}
$idArchive = $pluginsArchiver->finalizeArchive();
return array( $idArchive, $visits);

if (!$this->params->isSingleSiteDayArchive() && $visits) {
ArchiveSelector::purgeOutdatedArchives($this->params->getPeriod()->getDateStart());
}

return array($idArchive, $visits);
}

protected function doesRequestedPluginIncludeVisitsSummary()
Expand Down
4 changes: 0 additions & 4 deletions core/ArchiveProcessor/PluginsArchiver.php
Expand Up @@ -98,10 +98,6 @@ public function callAggregateAllPlugins($visits, $visitsConverted)
}
}
}

if (!$this->isSingleSiteDayArchive && $visits) {
ArchiveSelector::purgeOutdatedArchives($this->params->getPeriod()->getDateStart());
}
}

public function finalizeArchive()
Expand Down
3 changes: 0 additions & 3 deletions tests/PHPUnit/UITest.php
Expand Up @@ -52,7 +52,6 @@ public static function setUpBeforeClass()
AssetManager::getInstance()->removeMergedAssets();

// launch archiving so tests don't run out of time
Rules::$purgeDisabledByTests = true;
$date = Date::factory(static::$fixture->dateTime)->toString();
API::getInstance()->get(static::$fixture->idSite, 'year', $date);

Expand Down Expand Up @@ -184,8 +183,6 @@ protected function compareScreenshot($name, $urlQuery)
list($processedPath, $expectedPath) = self::getProcessedAndExpectedScreenshotPaths($name);

$this->compareScreenshotAgainstExpected($name, $urlQuery, $processedPath, $expectedPath);


}

private function saveImageDiff($expectedPath, $processedPath, $diffPath)
Expand Down

0 comments on commit 6980299

Please sign in to comment.