mirror of
https://github.com/benbusby/farside.git
synced 2025-06-08 10:26:36 +00:00
show fallback if there are no instances avail
This commit is contained in:
parent
9b7c544466
commit
e2ca414f79
3 changed files with 12 additions and 2 deletions
|
@ -39,6 +39,15 @@ defmodule Farside do
|
|||
|> Enum.reduce(%{}, fn service, acc ->
|
||||
{_, data} = :ets.lookup(String.to_atom(service), :data) |> List.first()
|
||||
|
||||
instances =
|
||||
case Enum.count(data.instances) == 0 do
|
||||
true ->
|
||||
[data.fallback]
|
||||
|
||||
false ->
|
||||
data.instances
|
||||
end
|
||||
|
||||
Map.put(
|
||||
acc,
|
||||
String.replace_prefix(
|
||||
|
@ -46,7 +55,7 @@ defmodule Farside do
|
|||
@service_prefix,
|
||||
""
|
||||
),
|
||||
data.instances
|
||||
instances
|
||||
)
|
||||
end)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue