diff options
author | diosmosis <diosmosis@users.noreply.github.com> | 2020-12-14 04:30:59 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-14 04:30:59 +0300 |
commit | 14f852fcdf4c28e0cc3f93a62dbc9697a9cfdf5c (patch) | |
tree | aeba763945aed02a423d34aaa70307169c84aab7 /core | |
parent | 8f980c43988efd77dfbb15f48d64e6f987d45555 (diff) |
add note message when continuing an existing queue (#16765)
* add note message when continuing an existing queue
* move message
* check if method exists
Diffstat (limited to 'core')
-rw-r--r-- | core/CronArchive.php | 7 | ||||
-rw-r--r-- | core/CronArchive/FixedSiteIds.php | 8 | ||||
-rw-r--r-- | core/CronArchive/SharedSiteIds.php | 10 |
3 files changed, 24 insertions, 1 deletions
diff --git a/core/CronArchive.php b/core/CronArchive.php index cc7d228c63..477720a892 100644 --- a/core/CronArchive.php +++ b/core/CronArchive.php @@ -303,6 +303,12 @@ class CronArchive $this->allWebsites = $websitesIds; $this->websiteIdArchiveList = $this->makeWebsiteIdArchiveList($websitesIds); + if (method_exists($this->websiteIdArchiveList, 'isContinuingPreviousRun') && + $this->websiteIdArchiveList->isContinuingPreviousRun() + ) { + $this->logger->info("- Continuing ongoing archiving run by pulling from shared idSite queue."); + } + if ($this->archiveFilter) { $this->archiveFilter->logFilterInfo($this->logger); } @@ -336,7 +342,6 @@ class CronArchive return; } - $this->logger->debug("Applying queued rearchiving..."); $this->invalidator->applyScheduledReArchiving(); diff --git a/core/CronArchive/FixedSiteIds.php b/core/CronArchive/FixedSiteIds.php index 041068b717..5aefab1a24 100644 --- a/core/CronArchive/FixedSiteIds.php +++ b/core/CronArchive/FixedSiteIds.php @@ -62,4 +62,12 @@ class FixedSiteIds return null; } + + /** + * @return bool + */ + public function isContinuingPreviousRun(): bool + { + return false; + } } diff --git a/core/CronArchive/SharedSiteIds.php b/core/CronArchive/SharedSiteIds.php index e070857bd4..cb880f579e 100644 --- a/core/CronArchive/SharedSiteIds.php +++ b/core/CronArchive/SharedSiteIds.php @@ -30,6 +30,7 @@ class SharedSiteIds private $currentSiteId; private $done = false; private $numWebsitesLeftToProcess; + private $isContinuingPreviousRun = false; public function __construct($websiteIds, $optionName = self::OPTION_DEFAULT) { @@ -46,6 +47,7 @@ class SharedSiteIds $existingWebsiteIds = $self->getAllSiteIdsToArchive(); if (!empty($existingWebsiteIds)) { + $this->isContinuingPreviousRun = true; return $existingWebsiteIds; } @@ -199,4 +201,12 @@ class SharedSiteIds { return Process::isSupported(); } + + /** + * @return bool + */ + public function isContinuingPreviousRun(): bool + { + return $this->isContinuingPreviousRun; + } } |