From 9fbd964f675d978d5f2206fc616573c56471b03d Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Tue, 9 Jul 2024 16:10:27 -0500 Subject: [PATCH] Wait for call attempt to start before returning This should prevent calls from ending before they start... I hope --- web.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web.rb b/web.rb index 2a0431c..69b5564 100644 --- a/web.rb +++ b/web.rb @@ -455,8 +455,9 @@ class Web < Roda ).then do |ca| r.json { ca.to_json } - call_attempt_repo.starting_call(c, params["callId"]) - render(*ca.to_render) + call_attempt_repo.starting_call(c, params["callId"]).then do + render(*ca.to_render) + end end }.catch_only(CustomerRepo::NotFound) { render "outbound/no_customer" -- 2.45.2