Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Improve some comments for clarity
  • Loading branch information
hiett committed Jul 29, 2023
commit 8155c92507367b51e9e00e8205be4d19d3998bbd
4 changes: 3 additions & 1 deletion lib/srh/redis/client_worker.ex
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ defmodule Srh.Redis.ClientWorker do
{:ok, res} ->
{:reply, {:ok, res}, state}

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