forked from hiway/freedive
Use refresh_service! to reduce cli calls
This commit is contained in:
parent
d6b2522fdc
commit
699cd61e0e
1 changed files with 4 additions and 2 deletions
|
@ -81,8 +81,10 @@ defmodule Freedive.Api.Service do
|
||||||
broadcast(:stdlog, %{name: name, log: std_to_log(reason)})
|
broadcast(:stdlog, %{name: name, log: std_to_log(reason)})
|
||||||
end
|
end
|
||||||
|
|
||||||
broadcast(:refreshed, service_details(name))
|
curr_service = state[:services][name]
|
||||||
|
refreshed_service = refresh_service!(curr_service)
|
||||||
|
state = %{state | services: Map.put(state[:services], name, refreshed_service)}
|
||||||
|
broadcast(:refreshed, refreshed_service)
|
||||||
{:noreply, state}
|
{:noreply, state}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue