Skip to content

Commit 10dfc4e

Browse files
Merge pull request #687 from mozilla/feature/dialog_pods_cache
Prefer stale dialog pod data to invalid results
2 parents dc5838d + e31af07 commit 10dfc4e

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

lib/ret/load_balancing/janus_load_status.ex

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,14 @@ defmodule Ret.JanusLoadStatus do
1010
if module_config(:janus_service_name) == "" do
1111
{:ok, [{:host_to_ccu, [{module_config(:default_janus_host), 0}]}]}
1212
else
13-
with pods when pods != [] <- get_dialog_pods() do
13+
pods = get_dialog_pods()
14+
15+
if length(pods) > 0 do
1416
{:ok, [{:host_to_ccu, pods}]}
1517
else
16-
_ ->
17-
Logger.warning(
18-
"falling back to default_janus_host because get_dialog_pods() returned []"
19-
)
20-
21-
{:ok, [{:host_to_ccu, [{module_config(:default_janus_host), 0}]}]}
18+
# get_dialog_pods/0 can fail to find hosts for reasons we don't fully understand
19+
# If this happens, don't update the cache.
20+
:ignore
2221
end
2322
end
2423
else

0 commit comments

Comments
 (0)