]> Entropealabs - wampex_router.git/commitdiff
remove time publish resource
authorChristopher <chris@entropealabs.com>
Fri, 17 Apr 2020 01:57:31 +0000 (20:57 -0500)
committerChristopher <chris@entropealabs.com>
Fri, 17 Apr 2020 01:57:31 +0000 (20:57 -0500)
lib/router/session.ex

index 9bf529470d47fdf5767839b6ab92429b9259860a..dc81df2294ef9aad8dbc35dec4cb3072d6a52ef2 100644 (file)
@@ -323,27 +323,23 @@ defmodule Wampex.Router.Session do
     {data, actions} =
       case is_authorized?(am, peer, :publish, topic) do
         true ->
-          {id_time, pub_id} = :timer.tc(fn -> RealmSession.get_id() end)
-
-          {subs_time, subs} = :timer.tc(fn -> RealmSession.subscriptions(db, realm, topic) end)
-
-          {put_time, details} = :timer.tc(fn -> Map.put_new(opts, "topic", topic) end)
-
-          {send_time, _} =
-            :timer.tc(fn ->
-              Enum.each(subs, fn {id, {pid, node}} ->
-                send(
-                  {proxy, node},
-                  {%Event{
-                     subscription_id: id,
-                     publication_id: pub_id,
-                     arg_list: arg_l,
-                     arg_kw: arg_kw,
-                     details: details
-                   }, pid}
-                )
-              end)
-            end)
+          pub_id = RealmSession.get_id()
+
+          subs = RealmSession.subscriptions(db, realm, topic)
+          details = Map.put_new(opts, "topic", topic)
+
+          Enum.each(subs, fn {id, {pid, node}} ->
+            send(
+              {proxy, node},
+              {%Event{
+                 subscription_id: id,
+                 publication_id: pub_id,
+                 arg_list: arg_l,
+                 arg_kw: arg_kw,
+                 details: details
+               }, pid}
+            )
+          end)
 
           case opts do
             %{"acknowledge" => true} ->
@@ -353,12 +349,6 @@ defmodule Wampex.Router.Session do
               :noop
           end
 
-          Logger.info(
-            "ID Time: #{inspect(id_time)} \n SUBS Time: #{inspect(subs_time)} \n PUT Time: #{inspect(put_time)} \n SEND Time: #{
-              inspect(send_time)
-            }"
-          )
-
           {sl, [{:next_event, :internal, :transition}]}
 
         false ->