diff --git a/lib/wanderer_app/env.ex b/lib/wanderer_app/env.ex index 266557f1..1c0e8f2c 100644 --- a/lib/wanderer_app/env.ex +++ b/lib/wanderer_app/env.ex @@ -23,7 +23,7 @@ defmodule WandererApp.Env do cache: WandererApp.Cache, key: "map-connection-auto-expire-hours" ) - def map_connection_auto_expire_hours, do: get_key(:map_connection_auto_eol_hours) + def map_connection_auto_expire_hours, do: get_key(:map_connection_auto_expire_hours) @decorate cacheable( cache: WandererApp.Cache, diff --git a/lib/wanderer_app/map/server/map_server_connections_impl.ex b/lib/wanderer_app/map/server/map_server_connections_impl.ex index ab897d95..2b2bc4d3 100644 --- a/lib/wanderer_app/map/server/map_server_connections_impl.ex +++ b/lib/wanderer_app/map/server/map_server_connections_impl.ex @@ -82,12 +82,14 @@ defmodule WandererApp.Map.Server.ConnectionsImpl do :timer.minutes(get_eol_expire_timeout_mins()) def init_eol_cache(map_id, connections_eol_time) do + eol_expire_timeout = get_eol_expire_timeout() + connections_eol_time |> Enum.each(fn {connection_id, connection_eol_time} -> WandererApp.Cache.put( "map_#{map_id}:conn_#{connection_id}:mark_eol_time", connection_eol_time, - ttl: get_eol_expire_timeout() + ttl: eol_expire_timeout ) end) end @@ -201,8 +203,8 @@ defmodule WandererApp.Map.Server.ConnectionsImpl do do: update_connection(state, :update_custom_info, [:custom_info], connection_update) def cleanup_connections(%{map_id: map_id} = state) do - connection_auto_eol_hours = get_connection_auto_eol_hours() connection_auto_expire_hours = get_connection_auto_expire_hours() + connection_auto_eol_hours = get_connection_auto_eol_hours() state = map_id