@@ -396,8 +396,8 @@ async def sync_crawls(self, data: MCSyncData):
396396 if status .pagesFound < status .desiredScale :
397397 status .desiredScale = max (1 , status .pagesFound )
398398
399- # paused and shut down pods if size is <= 4096 (empty dir)
400- # paused_at is set state is a valid paused state
399+ # paused and shut down pods if size is <= 4096 (empty dir),
400+ # paused_at is set, and state is a valid paused state
401401 is_paused = (
402402 bool (crawl .paused_at )
403403 and status .sizePending <= 4096
@@ -1463,14 +1463,11 @@ async def is_crawl_stopping(
14631463
14641464 # pause crawl if storage quota is reached
14651465 if org .quotas .storageQuota :
1466- # Make sure to account for already-uploaded WACZs from active crawls
1467- # that are or previously were paused, which are already accounted for
1468- # in the org storage stats
1469- active_crawls_total_size = await self .crawl_ops .get_active_crawls_size (
1470- crawl .oid
1466+ # include not-yet-uploaded pending data from all active crawls
1467+ active_crawls_pending_size = (
1468+ await self .crawl_ops .get_active_crawls_pending_size (crawl .oid )
14711469 )
1472-
1473- if self .org_ops .storage_quota_reached (org , active_crawls_total_size ):
1470+ if self .org_ops .storage_quota_reached (org , active_crawls_pending_size ):
14741471 return self .request_pause_crawl ("paused_storage_quota_reached" , crawl )
14751472
14761473 # pause crawl if execution time quota is reached
0 commit comments