mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-03-30 12:21:57 +00:00
feat:Deamons need over time after start
This commit is contained in:
@@ -15,7 +15,6 @@ export function healthCheck(o: {
|
||||
}) {
|
||||
new Promise(async () => {
|
||||
let currentValue: TriggerInput = {
|
||||
lastResult: null,
|
||||
hadSuccess: false,
|
||||
}
|
||||
const getCurrentValue = () => currentValue
|
||||
@@ -33,9 +32,9 @@ export function healthCheck(o: {
|
||||
message,
|
||||
})
|
||||
currentValue.hadSuccess = true
|
||||
currentValue.lastResult = "success"
|
||||
currentValue.lastResult = "passing"
|
||||
} catch (_) {
|
||||
currentValue.lastResult = "failure"
|
||||
currentValue.lastResult = "failing"
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import { HealthStatus } from "../../types"
|
||||
|
||||
export type TriggerInput = {
|
||||
lastResult?: "success" | "failure" | null
|
||||
lastResult?: HealthStatus
|
||||
hadSuccess?: boolean
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ export function changeOnFirstSuccess(o: {
|
||||
beforeFirstSuccess.next()
|
||||
for (
|
||||
let res = await beforeFirstSuccess.next();
|
||||
currentValue?.lastResult !== "success" && !res.done;
|
||||
currentValue?.lastResult !== "passing" && !res.done;
|
||||
res = await beforeFirstSuccess.next()
|
||||
) {
|
||||
yield
|
||||
|
||||
Reference in New Issue
Block a user