From a9b71c12e79d93147ec1a5bfba20f138e46e8469 Mon Sep 17 00:00:00 2001 From: Christopher Date: Thu, 16 Apr 2020 10:43:49 -0500 Subject: [PATCH] remove with statement --- lib/router/realms/session.ex | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/router/realms/session.ex b/lib/router/realms/session.ex index 7d2aeed..bfc508d 100644 --- a/lib/router/realms/session.ex +++ b/lib/router/realms/session.ex @@ -19,9 +19,16 @@ defmodule Wampex.Router.Realms.Session do def callees(db, realm, procedure) do Logger.info("Getting callees for #{inspect(procedure)} in realm #{inspect(realm)}") - {_key, callees} = ClusterKV.get(db, realm, procedure, 500) - {_key, [callee_index]} = ClusterKV.get(db, realm, "#{procedure}:callee_index") - {callees, callee_index} + case ClusterKV.get(db, realm, procedure, 500) do + :not_found -> + :not_found + + {_key, callees} -> + Logger.info("Got Callees: #{inspect(callees)}") + {_key, [callee_index]} = ClusterKV.get(db, realm, "#{procedure}:callee_index") + Logger.info("Got Index: #{callee_index}") + {callees, callee_index} + end end def round_robin(db, realm, procedure, len) do -- 2.45.3