1
0
Fork 0
mirror of https://github.com/benbusby/farside.git synced 2025-06-08 18:36:36 +00:00
This commit is contained in:
mithereal 2022-09-17 12:09:04 -07:00
parent 03e46f81f8
commit 84caea3af2
17 changed files with 402 additions and 140 deletions

View file

@ -5,6 +5,8 @@ defmodule Farside.Server.DeadCheck do
use Task
alias Farside.LastUpdated
require Logger
def child_spec(args) do
%{
id: __MODULE__,
@ -20,7 +22,7 @@ defmodule Farside.Server.DeadCheck do
def poll() do
receive do
after
1_200_000 ->
86_400_000 ->
run()
poll()
end
@ -29,6 +31,8 @@ defmodule Farside.Server.DeadCheck do
def run() do
LastUpdated.value(DateTime.utc_now())
Logger.info("Dead Service Check Running")
Registry.dispatch(:status, "dead", fn entries ->
for {pid, _} <- entries, do: GenServer.cast(pid, :check)
end)