Skip to content

Commit 8155c92

Browse files
committed
Improve some comments for clarity
1 parent 1b2415c commit 8155c92

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/srh/redis/client_worker.ex

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ defmodule Srh.Redis.ClientWorker do
3131
{:ok, res} ->
3232
{:reply, {:ok, res}, state}
3333

34+
# Both connection errors and Redis command errors will be handled here
3435
{:error, res} ->
3536
{:reply, {:error, res}, state}
3637
end
@@ -61,7 +62,8 @@ defmodule Srh.Redis.ClientWorker do
6162
} = state
6263
)
6364
when is_binary(connection_string) do
64-
# Will cause a crash for this genserver if the connection fails
65+
# NOTE: Redix only seems to open the connection when the first command is sent
66+
# This means that this will return :ok even if the connection string may not actually be connectable
6567
{:ok, pid} = Redix.start_link(connection_string)
6668
{:noreply, %{state | redix_pid: pid}}
6769
end

0 commit comments

Comments
 (0)