mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-03-26 10:21:55 +00:00
Merge pull request #8 from Start9Labs/feat/run-health-script
add default run health check as script
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.vscode
|
||||
@@ -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 },
|
||||
|
||||
Reference in New Issue
Block a user