Spaces:
Sleeping
Sleeping
hiett
commited on
Commit
·
fa07385
1
Parent(s):
28b00d6
All 3 methods are now destroying pools on failures, need to test normal functionality then can remove logging
Browse files
lib/srh/http/command_handler.ex
CHANGED
|
@@ -130,6 +130,12 @@ defmodule Srh.Http.CommandHandler do
|
|
| 130 |
# Fire back the result here, because the initial Multi was successful
|
| 131 |
result
|
| 132 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 133 |
{:error, error} ->
|
| 134 |
decode_error(error, srh_id)
|
| 135 |
end
|
|
|
|
| 130 |
# Fire back the result here, because the initial Multi was successful
|
| 131 |
result
|
| 132 |
|
| 133 |
+
{:error, %{reason: :closed} = error} ->
|
| 134 |
+
IO.puts("Transaction error: #{inspect(error)}")
|
| 135 |
+
# Ensure that this pool is killed, but still pass the error up the chain for the response
|
| 136 |
+
Client.destroy_workers(client_pid)
|
| 137 |
+
decode_error(error, srh_id)
|
| 138 |
+
|
| 139 |
{:error, error} ->
|
| 140 |
decode_error(error, srh_id)
|
| 141 |
end
|
lib/srh/redis/client_worker.ex
CHANGED
|
@@ -18,6 +18,7 @@ defmodule Srh.Redis.ClientWorker do
|
|
| 18 |
end
|
| 19 |
|
| 20 |
def redis_command(worker, command_array) do
|
|
|
|
| 21 |
GenServer.call(worker, {:redis_command, command_array})
|
| 22 |
end
|
| 23 |
|
|
|
|
| 18 |
end
|
| 19 |
|
| 20 |
def redis_command(worker, command_array) do
|
| 21 |
+
IO.puts("redis_command (for pid #{inspect(worker)}): #{inspect(command_array)}")
|
| 22 |
GenServer.call(worker, {:redis_command, command_array})
|
| 23 |
end
|
| 24 |
|