From 0a5b7527b8451d882de34144a4e1713747eef75a Mon Sep 17 00:00:00 2001 From: Lucy Cifferello <12953208+elvece@users.noreply.github.com> Date: Thu, 27 Oct 2022 17:52:02 -0600 Subject: [PATCH] add default run health check as script --- healthUtil.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/healthUtil.ts b/healthUtil.ts index d332fe5..8c8b5db 100644 --- a/healthUtil.ts +++ b/healthUtil.ts @@ -19,6 +19,15 @@ export const checkWebUrl: ( }; }; +export const runHealthScript = ({command, args}: { command: string, args: string[] }) => async (effects: Effects, _duration: number): Promise> => { + const res = await effects.runCommand({ command, args }) + if ('result' in res){ + return { result: null } + } else { + return res + } +} + // Ensure the starting duration is pass a minimum export const guardDurationAboveMinimum = ( input: { duration: number; minimumTime: number },