Use proper timeout for API calls
This commit is contained in:
parent
950e0896e7
commit
0a2b7a9892
1 changed files with 2 additions and 1 deletions
|
@ -118,7 +118,8 @@ defmodule GeoTherminator.PumpAPI.Device.Server do
|
||||||
[status, registers, opstat] =
|
[status, registers, opstat] =
|
||||||
Task.async_stream(
|
Task.async_stream(
|
||||||
[&Device.API.status/2, &Device.API.register_info/2, &Device.API.opstat/2],
|
[&Device.API.status/2, &Device.API.register_info/2, &Device.API.opstat/2],
|
||||||
& &1.(user, state.device)
|
& &1.(user, state.device),
|
||||||
|
timeout: Application.get_env(:geo_therminator, :api_timeout)
|
||||||
)
|
)
|
||||||
|> Enum.map(fn {:ok, val} -> val end)
|
|> Enum.map(fn {:ok, val} -> val end)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue