Skip to content

Commit

Permalink
refs #5933 we must specifically invalidate day reports so that monthl…
Browse files Browse the repository at this point in the history
…y reports have a chance to be re-processed. added note in the API comment.
  • Loading branch information
mattab committed Sep 21, 2014
1 parent 2133945 commit b82aca5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion plugins/CoreAdminHome/API.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ public function runScheduledTasks()
*
* @param string $idSites Comma separated list of idSite that have had data imported for the specified dates
* @param string $dates Comma separated list of dates to invalidate for all these websites
* @param string $period If specified (one of day, week, month, year, range) it will only delete archives for this period
* @param string $period If specified (one of day, week, month, year, range) it will only delete archives for this period.
* Note: because week, month, year, range reports aggregate day reports then you need to specifically invalidate day reports to see
* other periods reports processed..
* @throws Exception
* @return array
*/
Expand Down
4 changes: 3 additions & 1 deletion tests/PHPUnit/Integration/ArchiveInvalidationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ protected function invalidateTestArchives()
$r = new Request("module=API&method=CoreAdminHome.invalidateArchivedReports&idSites=" . self::$fixture->idSite1 . "&dates=" . $dateToInvalidate1->format('Y-m-d'));
$this->assertApiResponseHasNoError($r->process());

// Month reports only are invalidated and we test our weekly report will still show old data.
// Days & Months reports only are invalidated and we test our weekly report will still show old data.
$r = new Request("module=API&method=CoreAdminHome.invalidateArchivedReports&period=day&idSites=" . self::$fixture->idSite2 . "&dates=" . $dateToInvalidate2->format('Y-m-d'));
$this->assertApiResponseHasNoError($r->process());
$r = new Request("module=API&method=CoreAdminHome.invalidateArchivedReports&period=month&idSites=" . self::$fixture->idSite2 . "&dates=" . $dateToInvalidate2->format('Y-m-d'));
$this->assertApiResponseHasNoError($r->process());

Expand Down

0 comments on commit b82aca5

Please sign in to comment.