feat: Move from properties to vault

This commit is contained in:
BluJ
2023-05-04 15:13:16 -06:00
parent e68b4b7652
commit 50bcad0300
7 changed files with 18 additions and 138 deletions

View File

@@ -44,10 +44,22 @@ export function healthCheck(o: {
await triggerFirstSuccess().catch((err) => {
console.error(err)
})
} catch (_) {
} catch (e) {
await o.effects.setHealth({
name: o.name,
status: "failing",
message: asMessage(e),
})
currentValue.lastResult = "failing"
}
}
})
return {} as HealthReceipt
}
function asMessage(e: unknown) {
if (typeof e === "object" && e != null && "message" in e)
return String(e.message)
const value = String(e)
if (value.length == null) return undefined
return value
}