Skip to content

Commit

Permalink
chore(data-warehouse): don't raise if schedule already gone (#18978)
Browse files Browse the repository at this point in the history
don't raise if schedule already gone
  • Loading branch information
EDsCODE authored Nov 30, 2023
1 parent 4da5395 commit e7ba706
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion posthog/warehouse/data_load/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
ExternalDataJobWorkflow,
)
from posthog.warehouse.models import ExternalDataSource
import temporalio


def sync_external_data_job_workflow(external_data_source: ExternalDataSource, create: bool = False) -> str:
Expand Down Expand Up @@ -66,4 +67,10 @@ def pause_external_data_workflow(external_data_source: ExternalDataSource):

def delete_external_data_workflow(external_data_source: ExternalDataSource):
temporal = sync_connect()
delete_schedule(temporal, schedule_id=str(external_data_source.id))
try:
delete_schedule(temporal, schedule_id=str(external_data_source.id))
except temporalio.service.RPCError as e:
# Swallow error if schedule does not exist already
if e.status == temporalio.service.RPCStatusCode.NOT_FOUND:
return
raise

0 comments on commit e7ba706

Please sign in to comment.