From 23ad329cf257d7846f2f47e601df379a332e02fd Mon Sep 17 00:00:00 2001 From: Richard Dominick <34370238+RichDom2185@users.noreply.github.com> Date: Mon, 18 Sep 2023 00:57:56 +0800 Subject: [PATCH] Revert "Configure sweeper interval in minutes" This reverts commit f27a4700bcfb8fa5a19b42ba9d175d076e4ee09d. --- lib/guardian/db/sweeper.ex | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/lib/guardian/db/sweeper.ex b/lib/guardian/db/sweeper.ex index aaa9971..6db6654 100644 --- a/lib/guardian/db/sweeper.ex +++ b/lib/guardian/db/sweeper.ex @@ -18,10 +18,10 @@ defmodule Guardian.DB.Sweeper do alias Guardian.DB.Token - @sixty_minutes 60 + @sixty_minutes 60 * 60 * 1000 def start_link(opts) do - interval = Keyword.get(opts, :interval, @sixty_minutes) |> minute_to_ms() + interval = Keyword.get(opts, :interval, @sixty_minutes) GenServer.start_link(__MODULE__, [interval: interval], name: __MODULE__) end @@ -72,13 +72,4 @@ defmodule Guardian.DB.Sweeper do [interval: interval, timer: timer] end - - defp minute_to_ms(value) when is_binary(value) do - value - |> String.to_integer() - |> minute_to_ms() - end - - defp minute_to_ms(value) when value < 1, do: 1000 - defp minute_to_ms(value), do: round(value * 60 * 1000) end