File 0001-Fixed-case-where-is_pid-times-out-and-would-unfortun.patch of Package jc

From ac5149b2895aec1cac3d3e98f2bbdbb1d42e5122 Mon Sep 17 00:00:00 2001
From: "Rosenblum, Jim" <jim.rosenblum@gmail.com>
Date: Tue, 10 Oct 2017 08:58:04 -0700
Subject: [PATCH] Fixed case where is_pid times out and would unfortunately
 match not undefined

---
 src/jc.erl | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/jc.erl b/src/jc.erl
index e22124c..0dd8a9f 100644
--- a/src/jc.erl
+++ b/src/jc.erl
@@ -145,7 +145,7 @@ cache_nodes() ->
     Configured = application:get_env(jc, cache_nodes,[]),
     MnesiaUp = jc_store:up_nodes(),
     Running = [N || N <- MnesiaUp, 
-		   undefined /= rpc:call(N, erlang, whereis, [jc_bridge], 1000)],
+		   is_pid(rpc:call(N, erlang, whereis, [jc_bridge], 1000))],
     {{active, lists:sort(Running)}, {configured, lists:sort(Configured)}}.
 
 
@@ -222,7 +222,8 @@ put_all(_m, _K, _T) ->
 
 clear(Map) ->
     lager:debug("~p: clear map ~p.", [?MODULE, Map]),
-    jc_store:clear(Map),
+    F = fun() -> jc_store:clear(Map) end,
+    trans_execute(F),
     ok.
 
 
@@ -490,7 +491,7 @@ fun_match(Map, Criteria, Fun) ->
 trans_execute(F) ->
     case mnesia:is_transaction() of
 	true ->     F();
-	false ->    mnesia:sync_dirty(F)
+	false ->    mnesia:async_dirty(F)
     end.
 
 
-- 
2.16.1

openSUSE Build Service is sponsored by