From 2b83dcc79441d6c17be495760eeb98ce548f6198 Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Tue, 23 Dec 2025 14:11:32 -0500 Subject: [PATCH] nix: sleep param for withPgrst --- nix/tools/withTools.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nix/tools/withTools.nix b/nix/tools/withTools.nix index eddffdd29..e61ad5c76 100644 --- a/nix/tools/withTools.nix +++ b/nix/tools/withTools.nix @@ -361,7 +361,8 @@ 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_OPTIONAL_SINGLE([timeout], [t], [Maximum time to wait for PostgREST to be ready], [5])" + "ARG_OPTIONAL_SINGLE([sleep], [s], [Sleep time after PostgREST is ready, this is useful for monitoring], [0])" "ARG_USE_ENV([PGRST_CMD], [], [PostgREST executable to run])" ]; positionalCompletion = "_command"; @@ -426,6 +427,10 @@ let ${monitorPid} "$pid" > "$_arg_monitor" & fi + if [[ -n "$_arg_sleep" ]]; then + sleep "$_arg_sleep" + fi + ("$_arg_command" "''${_arg_leftovers[@]}") '';