Skip to content

Commit

Permalink
Add temp logger statements
Browse files Browse the repository at this point in the history
  • Loading branch information
VeljkoMaksimovic committed Dec 26, 2022
1 parent 728271a commit bb1c368
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions lib/cacheman.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
defmodule Cacheman do
require Logger

@doc """
Cacheman is a Redis backed Rails.cache equivalent for Elixir applications.
Expand Down Expand Up @@ -310,6 +312,9 @@ defmodule Cacheman do
end

def handle_call({:put_batch, key_value_pairs, put_opts}, _from, opts) do
# TODO temp logger
Logger.info("[Cacheman] OPTS: #{inspect(put_opts)}")

response =
apply(opts.backend_module, :put_batch, [
opts.backend_pid,
Expand Down
8 changes: 7 additions & 1 deletion lib/cacheman/backend/redis.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
defmodule Cacheman.Backend.Redis do
require Logger

def start_link(opts) do
poolboy_config = [
{:worker_module, Redix},
Expand Down Expand Up @@ -59,7 +61,11 @@ defmodule Cacheman.Backend.Redis do
end)

:poolboy.transaction(conn, fn c ->
Redix.pipeline(c, list_of_commands, timeout: opts[:timeout])
# TODO temp loggers
Logger.info("Redis timeout: #{inspect(opts[:timeout])}")
ret = Redix.pipeline(c, list_of_commands, timeout: opts[:timeout])
Logger.info("Redis ret: #{inspect(ret)}")
ret
end)
end

Expand Down

0 comments on commit bb1c368

Please sign in to comment.