From 23677b312932198afc647646e94479c3bc25d6da Mon Sep 17 00:00:00 2001 From: Federico Mastellone Date: Mon, 29 May 2023 17:54:46 +0000 Subject: [PATCH] WIP WIP WIP WIP --- nix/workbench/service/healthcheck.nix | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/nix/workbench/service/healthcheck.nix b/nix/workbench/service/healthcheck.nix index 0ef8dd3afd7..d065b2b5965 100644 --- a/nix/workbench/service/healthcheck.nix +++ b/nix/workbench/service/healthcheck.nix @@ -36,7 +36,7 @@ let # pipefail: Any failed command in a pipeline is used as return code set -euo pipefail - echo "$(date --rfc-3339=seconds): started" + echo "$(${coreutils}/bin/date --rfc-3339=seconds): started" # Fetch every node name (Including "explorer" nodes) nodes=$(${jq}/bin/jq --raw-output "keys | join (\" \")" ../node-specs.json) @@ -45,7 +45,7 @@ let echo "Pools: ''${pools}" # Set the defaults! - now=$(date +%s) + now=$(${coreutils}/bin/date +%s) for node in ''${nodes[*]} do # Create a healthcheck directory inside every node directory @@ -109,7 +109,7 @@ let node_healthcheck_block "''${node}" node_healthcheck_txs "''${node}" else - local now=$(date +%s) + local now=$(${coreutils}/bin/date +%s) local start_time=$(cat "../''${node}/healthcheck/start_time") if test $((now - start_time)) -ge 300 then @@ -172,7 +172,7 @@ let function node_healthcheck_forge() { local node=$1 local start_time - local now=$(date +%s) + local now=$(${coreutils}/bin/date +%s) local last_forged last_forged=$(last_block_forged "''${node}" 2>&1) if test -z "''${last_forged}" @@ -195,7 +195,7 @@ let function node_healthcheck_block() { local node=$1 local start_time - local now=$(date +%s) + local now=$(${coreutils}/bin/date +%s) local last_block last_block=$(last_block_transmitted "''${node}" 2>&1) if test -z "''${last_block}" @@ -204,7 +204,7 @@ let if test $((now - start_time)) -ge 300 then # Stderr - echo "$(date --rfc-3339=seconds): ''${node}: More than 5m without a first block sent or received" >&2 + echo "$(${coreutils}/bin/date --rfc-3339=seconds): ''${node}: More than 5m without a first block sent or received" >&2 exit 1 fi else @@ -220,7 +220,7 @@ let function node_healthcheck_txs() { local node=$1 local start_time - local now=$(date +%s) + local now=$(${coreutils}/bin/date +%s) local last_txs last_txs=$(last_block_with_txs "''${node}" 2>&1) if test -z "''${last_txs}" @@ -526,13 +526,13 @@ let function exit_healthcheck { # Unbuffered stderr, if not the error message may be lost! - stdbuf -o0 -e0 echo -e "$(date --rfc-3339=seconds): $1" >&2 + stdbuf -o0 -e0 echo -e "$(${coreutils}/bin/date --rfc-3339=seconds): $1" >&2 exit 1 } function exit_22 { # Unbuffered stderr, if not the error message may be lost! - stdbuf -o0 -e0 echo -e "$(date --rfc-3339=seconds): $1" >&2 + stdbuf -o0 -e0 echo -e "$(${coreutils}/bin/date --rfc-3339=seconds): $1" >&2 exit 22 }