Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
fmaste committed May 31, 2023
1 parent 1a8baba commit 3bd7baf
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions nix/workbench/service/healthcheck.nix
Expand Up @@ -214,16 +214,14 @@ let
start_time=$(${coreutils}/bin/cat "../''${node}/healthcheck/start_time")
if test $((now - start_time)) -ge 300
then
# Stderr
${coreutils}/bin/echo "$(${coreutils}/bin/date --rfc-3339=seconds): ''${node}: More than 5m without a first block sent or received" >&2
exit 1
exit_healthcheck "''${node}: More than 5m without a first block sent or received"
fi
else
${coreutils}/bin/echo "''${last_block}" > "../''${node}/healthcheck/last_block"
start_time=$(${coreutils}/bin/echo "''${last_block}" | ${jq}/bin/jq .at)
if test $((now - start_time)) -ge 60
if test $((now - start_time)) -ge 180
then
exit_healthcheck "''${node}: More than 60s with no newer blocks sent or received\n''${last_block}"
exit_healthcheck "''${node}: More than 3m with no newer blocks sent or received\n''${last_block}"
fi
fi
}
Expand All @@ -244,9 +242,9 @@ let
else
${coreutils}/bin/echo "''${last_txs}" > "../''${node}/healthcheck/last_txs"
start_time=$(${coreutils}/bin/echo "''${last_txs}" | ${jq}/bin/jq .at)
if test $((now - start_time)) -ge 60
if test $((now - start_time)) -ge 180
then
exit_healthcheck "''${node}: More than 60s with no newer blocks with transactions\n''${last_txs}"
exit_healthcheck "''${node}: More than 3m with no newer blocks with transactions\n''${last_txs}"
fi
fi
}
Expand Down

0 comments on commit 3bd7baf

Please sign in to comment.