Skip to content

Commit 0ad1644

Browse files
committed
Check if email already sent from notify method
1 parent f2f2dcd commit 0ad1644

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

backend/btrixcloud/crawls.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,6 +1220,9 @@ async def notify_org_admins_of_auto_paused_crawl(
12201220
org: Organization,
12211221
):
12221222
"""Send email to all org admins about automatically paused crawl"""
1223+
if await self.get_auto_paused_emails_sent(crawl_id, org):
1224+
return
1225+
12231226
users = await self.orgs.get_users_for_org(org, UserRole.OWNER)
12241227
workflow = await self.crawl_configs.get_crawl_config_out(cid, org)
12251228

backend/btrixcloud/operator/crawls.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1654,12 +1654,7 @@ async def update_crawl_state(
16541654
allowed_from=RUNNING_AND_WAITING_STATES,
16551655
)
16561656

1657-
if (
1658-
paused_state != "paused"
1659-
and not await self.crawl_ops.get_auto_paused_emails_sent(
1660-
crawl.id, crawl.org
1661-
)
1662-
):
1657+
if paused_state != "paused":
16631658
await self.crawl_ops.notify_org_admins_of_auto_paused_crawl(
16641659
paused_reason=paused_state,
16651660
crawl_id=crawl.id,

0 commit comments

Comments
 (0)