From 24683d01616b87ee71fbcf4a33d8957a35b6dfb3 Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Sun, 21 Dec 2025 21:02:49 -0500 Subject: [PATCH 1/2] nix: timeout param for withPgrst --- nix/tools/withTools.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nix/tools/withTools.nix b/nix/tools/withTools.nix index 3417213539..1a6d140534 100644 --- a/nix/tools/withTools.nix +++ b/nix/tools/withTools.nix @@ -361,6 +361,7 @@ let "ARG_POSITIONAL_SINGLE([command], [Command to run])" "ARG_LEFTOVERS([command arguments])" "ARG_OPTIONAL_SINGLE([monitor], [m], [Enable CPU and memory monitoring of the PostgREST process and output to the designated file as markdown])" + "ARG_OPTIONAL_SINGLE([timeout], [t], [Timeout for the PostgREST process], [5])" "ARG_USE_ENV([PGRST_CMD], [], [PostgREST executable to run])" ]; positionalCompletion = "_command"; @@ -412,7 +413,7 @@ let } trap cleanup EXIT - timeout -s TERM 5 ${waitForPgrstReady} || { + timeout -s TERM "$_arg_timeout" ${waitForPgrstReady} || { echo "timed out, output:" cat "$tmpdir"/run.log exit 1 From a1cdecb224412cd0487752c6fc486154e84b2a0f Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Mon, 22 Dec 2025 19:51:00 -0500 Subject: [PATCH 2/2] nix: show wait time on withPgrst --- nix/tools/withTools.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nix/tools/withTools.nix b/nix/tools/withTools.nix index 1a6d140534..eddffdd299 100644 --- a/nix/tools/withTools.nix +++ b/nix/tools/withTools.nix @@ -413,12 +413,14 @@ let } trap cleanup EXIT + wait_start=$SECONDS timeout -s TERM "$_arg_timeout" ${waitForPgrstReady} || { echo "timed out, output:" cat "$tmpdir"/run.log exit 1 } - echo "done." + wait_duration=$((SECONDS - wait_start)) + printf "done in %ss.\n" "$wait_duration" if [[ -n "$_arg_monitor" ]]; then ${monitorPid} "$pid" > "$_arg_monitor" &