mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-06-07 07:55:16 +02:00
fix: set provider during campaign run (#69)
This commit is contained in:
parent
09897cb5d8
commit
8342cd1dda
2 changed files with 10 additions and 10 deletions
|
|
@ -365,16 +365,6 @@ async def _process_status_update(
|
|||
# Mark workflow run as completed
|
||||
await db_client.update_workflow_run(run_id=workflow_run_id, is_completed=True)
|
||||
|
||||
# Publish campaign event if applicable
|
||||
if workflow_run.campaign_id:
|
||||
publisher = await get_campaign_event_publisher()
|
||||
await publisher.publish_call_completed(
|
||||
campaign_id=workflow_run.campaign_id,
|
||||
workflow_run_id=workflow_run_id,
|
||||
queued_run_id=workflow_run.queued_run_id,
|
||||
call_duration=int(status.duration) if status.duration else 0,
|
||||
)
|
||||
|
||||
elif status.status in ["failed", "busy", "no-answer", "canceled"]:
|
||||
logger.warning(
|
||||
f"[run {workflow_run_id}] Call failed with status: {status.status}"
|
||||
|
|
|
|||
|
|
@ -245,6 +245,16 @@ class CampaignCallDispatcher:
|
|||
workflow_run_id=workflow_run.id,
|
||||
)
|
||||
|
||||
# Store provider type and metadata in gathered_context
|
||||
# (required for WebSocket handler to route to correct provider)
|
||||
await db_client.update_workflow_run(
|
||||
run_id=workflow_run.id,
|
||||
gathered_context={
|
||||
"provider": provider.PROVIDER_NAME,
|
||||
**(call_result.provider_metadata or {}),
|
||||
},
|
||||
)
|
||||
|
||||
logger.info(
|
||||
f"Call initiated for workflow run {workflow_run.id}, Call ID: {call_result.call_id}"
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue