From bb1c368b39b302b1d669dcda4c90daef31e58902 Mon Sep 17 00:00:00 2001 From: VeljkoMaksimovic Date: Mon, 26 Dec 2022 17:00:43 +0100 Subject: [PATCH] Add temp logger statements --- lib/cacheman.ex | 5 +++++ lib/cacheman/backend/redis.ex | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/cacheman.ex b/lib/cacheman.ex index 5b00868..7cfd690 100644 --- a/lib/cacheman.ex +++ b/lib/cacheman.ex @@ -1,4 +1,6 @@ defmodule Cacheman do + require Logger + @doc """ Cacheman is a Redis backed Rails.cache equivalent for Elixir applications. @@ -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, diff --git a/lib/cacheman/backend/redis.ex b/lib/cacheman/backend/redis.ex index 12da7d9..ba702a4 100644 --- a/lib/cacheman/backend/redis.ex +++ b/lib/cacheman/backend/redis.ex @@ -1,4 +1,6 @@ defmodule Cacheman.Backend.Redis do + require Logger + def start_link(opts) do poolboy_config = [ {:worker_module, Redix}, @@ -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