diff --git a/lib/aprsme/device_cache.ex b/lib/aprsme/device_cache.ex index da75e82..3d0abda 100644 --- a/lib/aprsme/device_cache.ex +++ b/lib/aprsme/device_cache.ex @@ -59,6 +59,18 @@ defmodule Aprsme.DeviceCache do {:ok, %{initial_load_done: false}} end + @impl true + def handle_call(:refresh_cache, _from, state) do + result = load_devices_into_cache() + {:reply, result, state} + end + + @impl true + def handle_cast(:refresh_cache_async, state) do + load_devices_into_cache() + {:noreply, state} + end + @impl true def handle_info(:initial_load, state) do # Load devices on startup @@ -75,19 +87,6 @@ defmodule Aprsme.DeviceCache do end end - @impl true - def handle_call(:refresh_cache, _from, state) do - result = load_devices_into_cache() - {:reply, result, state} - end - - @impl true - def handle_cast(:refresh_cache_async, state) do - load_devices_into_cache() - {:noreply, state} - end - - @impl true def handle_info(:refresh_cache, state) do load_devices_into_cache()