Skip to content

Commit

Permalink
Renaming agent.ex and adding comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew committed Aug 8, 2024
1 parent 06580ef commit c4ec9a0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# is restricted to this project.
import Config

config :turn_junebug_expressway, :agent, ttl: System.get_env("MESSAGE_TTL", "10000")
config :turn_junebug_expressway, :agent, ttl: System.get_env("RECIPIENT_ID_TTL", "10000")

# Configures the endpoint
config :turn_junebug_expressway, TurnJunebugExpresswayWeb.Endpoint,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ defmodule TurnJunebugExpressway.MessageRecipientIdCache do
state = %{}
{:ok, state}
end

# Setting the same key multiple times, does not extend its lifetime---each call schedules a new expiry
def handle_call({:put, key, value, ttl}, _from, state) do
Process.send_after(self(), {:expire, key}, ttl)
{:reply, :ok, Map.put(state, key, value)}
Expand Down

0 comments on commit c4ec9a0

Please sign in to comment.