diff --git a/backend/btrixcloud/operator/crawls.py b/backend/btrixcloud/operator/crawls.py index 9fc69b39a7..8a7b5e0995 100644 --- a/backend/btrixcloud/operator/crawls.py +++ b/backend/btrixcloud/operator/crawls.py @@ -1494,6 +1494,18 @@ async def update_crawl_state( # all expected pods are either done or failed all_completed = (num_done + num_failed) >= status.scale + # check paused + if not all_completed and crawl.paused_at and status.stopReason == "paused": + num_paused = status_count.get("interrupted", 0) + if (num_paused + num_failed) >= status.scale: + # now fully paused! + # remove pausing key and set state to paused + await redis.delete(f"{crawl.id}:paused") + await self.set_state( + "paused", status, crawl, allowed_from=RUNNING_AND_WAITING_STATES + ) + return status + # if at least one is done according to redis, consider crawl successful # ensure pod successfully exited as well # pylint: disable=chained-comparison @@ -1526,17 +1538,6 @@ async def update_crawl_state( else: await self.fail_crawl(crawl, status, pods, stats) - # check paused - elif crawl.paused_at and status.stopReason == "paused": - num_paused = status_count.get("interrupted", 0) - if (num_paused + num_failed) >= status.scale: - # now fully paused! - # remove pausing key and set state to paused - await redis.delete(f"{crawl.id}:paused") - await self.set_state( - "paused", status, crawl, allowed_from=RUNNING_AND_WAITING_STATES - ) - # check for other statuses, default to "running" else: new_status: TYPE_RUNNING_STATES = "running" diff --git a/frontend/docs/docs/user-guide/running-crawl.md b/frontend/docs/docs/user-guide/running-crawl.md index 68583be68b..df68c37137 100644 --- a/frontend/docs/docs/user-guide/running-crawl.md +++ b/frontend/docs/docs/user-guide/running-crawl.md @@ -1,6 +1,6 @@ # Modifying Running Crawls -Running crawls can be modified from the crawl workflow **Latest Crawl** tab. You may want to modify a runnning crawl if you find that the workflow is crawling pages that you didn't intend to archive, or if you want a boost of speed. +Running crawls can be modified from the crawl workflow **Latest Crawl** tab. You may want to modify a running crawl if you find that the workflow is crawling pages that you didn't intend to archive, or if you want a boost of speed. ## Crawl Workflow Status @@ -12,7 +12,8 @@ A crawl workflow that is in progress can be in one of the following states: | :btrix-status-dot: Starting | New resources are starting up. Crawling should begin shortly.| | :btrix-status-dot: Running | The crawler is finding and capturing pages! | | :btrix-status-dot: Stopping | A user has instructed this workflow to stop. Finishing capture of the current pages.| -| :btrix-status-dot: Finishing Crawl | The workflow has finished crawling and data is being packaged into WACZ files.| +| :btrix-status-dot: Finishing Downloads | The workflow has finished crawling and is finalizing downloads.| +| :btrix-status-dot: Generating WACZ | Data is being packaged into WACZ files.| | :btrix-status-dot: Uploading WACZ | WACZ files have been created and are being transferred to storage.| ## Watch Crawl diff --git a/frontend/src/components/detail-page-title.ts b/frontend/src/components/detail-page-title.ts index 41018d6aa0..db9c34ee8e 100644 --- a/frontend/src/components/detail-page-title.ts +++ b/frontend/src/components/detail-page-title.ts @@ -70,7 +70,7 @@ export class DetailPageTitle extends TailwindElement { private renderIcon() { if (!this.item?.state) return; - const crawlStatus = CrawlStatus.getContent(this.item.state, this.item.type); + const crawlStatus = CrawlStatus.getContent(this.item); let icon = html` -

- ${msg("Sorry, we couldn’t find that page")} -

-

- ${msg("Check the URL to make sure you’ve entered it correctly.")} -

-
- ${msg("Go to Home")} -
-

+ ${pageError({ + heading: msg("Sorry, we couldn’t find that page"), + detail: msg("Check the URL to make sure you’ve entered it correctly."), + primaryAction: html`${msg("Go to Home")}`, + secondaryAction: html` ${msg("Did you click a link to get here?")}