Merge pull request #8 from Start9Labs/feat/run-health-script

add default run health check as script
This commit is contained in:
J M
2022-11-02 12:55:54 -06:00
committed by GitHub
2 changed files with 10 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.vscode

View File

@@ -19,6 +19,15 @@ export const checkWebUrl: (
};
};
export const runHealthScript = ({command, args}: { command: string, args: string[] }) => async (effects: Effects, _duration: number): Promise<ResultType<null | void>> => {
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 },