Skip to content

Commit

Permalink
VIP
Browse files Browse the repository at this point in the history
  • Loading branch information
shahryarjb committed Jun 11, 2024
1 parent af0fb0b commit a01f1c0
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions lib/mnesia_repo.ex
Original file line number Diff line number Diff line change
Expand Up @@ -109,21 +109,23 @@ defmodule MishkaInstaller.MnesiaRepo do
end

@impl true
def handle_info(:health_check, state) do
# TODO: this function can have some checker
Process.send_after(__MODULE__, :health_check, 1000)
if Mix.env() != :test do
def handle_info(:health_check, state) do
# TODO: this function can have some checker
Process.send_after(__MODULE__, :health_check, 1000)

try do
MishkaInstaller.broadcast("mnesia", Map.get(state, :status), %{
identifier: :mishka_mnesia_repo,
local_tables: :mnesia.system_info(:local_tables),
schemas: schemas()
})
rescue
_ -> nil
end

{:noreply, state}
{:noreply, state}
end
else
def handle_info(:health_check, state) do
{:noreply, state}
end
end

def handle_info(info, state) do
Expand Down

0 comments on commit a01f1c0

Please sign in to comment.