Commits

Dmitry Belyaev  committed 97e91d6

lost file for previous commit

  • Participants
  • Parent commits 5fc4740

Comments (0)

Files changed (1)

File src/emongo_sup.erl

     supervisor:delete_child(?MODULE, PoolId).
 
 pools() ->
-    [{PoolId, Pid} || {PoolId, Pid, _, [emongo_pool]} <- supervisor:which_children(?MODULE)].
+    [{Id, Pid, Module} || {Id, Pid, _, [Module]}
+                              <- supervisor:which_children(?MODULE)].
+
+worker_pid(PoolId, Pools) ->
+    case lists:keyfind(PoolId, 1, Pools) of
+        {_, Pid, Module} ->
+            Module:pid(Pid);
+        _ ->
+            undefined
+    end.
+
 
 worker_pid(PoolId) ->
     case [{Pid, Module} || {Id, Pid, _, [Module]} <- supervisor:which_children(?MODULE), Id =:= PoolId] of