From d7dd3858f685bacbab3282e35c4ecb7f70dce0a7 Mon Sep 17 00:00:00 2001 From: Rowan Seymour Date: Tue, 10 Aug 2021 16:24:48 -0500 Subject: [PATCH] Tweak query to fetch IVR calls to retry to match new index --- core/models/channel_connection.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/models/channel_connection.go b/core/models/channel_connection.go index 97b2dad15..8603c87eb 100644 --- a/core/models/channel_connection.go +++ b/core/models/channel_connection.go @@ -291,8 +291,8 @@ FROM LEFT OUTER JOIN flows_flowstart_connections fsc ON cc.id = fsc.channelconnection_id WHERE cc.connection_type = 'V' AND - next_attempt < NOW() AND - (cc.status = 'E' OR cc.status = 'Q') + cc.status IN ('N', 'B', 'E') AND + next_attempt < NOW() ORDER BY cc.next_attempt ASC LIMIT