Jacob Perkins avatar Jacob Perkins committed 4229cb8

transparent reconnect fix in erldis_client (via Benjamin Black), vsn 0.1.3

Comments (0)

Files changed (3)

 {application, erldis, [
 	{description, "Erlang Redis application"},
-	{vsn, "0.1.2"},
+	{vsn, "0.1.3"},
 	{registered, [erldis_sup]},
 	{mod, {erldis_app, []}},
 	{applications, [kernel, stdlib]},

ebin/erldis.appup

-{"0.1.2", [
+{"0.1.3", [
+	{"0.1.2", [{load_module, erldis_client}]},
 	{"0.1.1", [
 		{load_module, erldis},
 		{load_module, erldis_client},
 		{add_module, erldis_sets}
 	]}
 ], [
+	{"0.1.2", [{load_module, erldis_client}]},
 	{"0.1.1", [
 		{load_module, erldis},
 		{load_module, erldis_client},

src/erldis_client.erl

 			Report = [{?MODULE, unable_to_connect}, {error, Why}, State],
 			error_logger:warning_report(Report),
 			State;
-		{ok, #redis{socket=Socket, _='_'}=NewState} ->
+		{ok, NewState} ->
+			Socket = NewState#redis.socket,
+			
 			if
 				DB == <<"0">> ->
 					ok;
 	gen_tcp:send(State#redis.socket, [Cmd|End]),
 	
 	case Remaining of
-		0 ->
-			{noreply, State#redis{remaining=1, calls=Queue}};
-		_ ->
-			{noreply,State#redis{calls=Queue}}
+		0 -> {noreply, State#redis{remaining=1, calls=Queue}};
+		_ -> {noreply, State#redis{calls=Queue}}
 	end;
 handle_cast(_, State) ->
 	{noreply, State}.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.