From: Christopher Date: Thu, 16 Apr 2020 15:43:49 +0000 (-0500) Subject: remove with statement X-Git-Url: http://git.entropealabs.com/?a=commitdiff_plain;h=a9b71c12e79d93147ec1a5bfba20f138e46e8469;p=wampex_router.git remove with statement --- 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