]> Entropealabs - wampex_router.git/commitdiff
remove with statement
authorChristopher <chris@entropealabs.com>
Thu, 16 Apr 2020 15:43:49 +0000 (10:43 -0500)
committerChristopher <chris@entropealabs.com>
Thu, 16 Apr 2020 15:43:49 +0000 (10:43 -0500)
lib/router/realms/session.ex

index 7d2aeed78b4bf32512a2102a38a803842543ef9e..bfc508d6d2564f99db13ba37244414e38ec8ac7b 100644 (file)
@@ -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