fix: allow partial callbacks in config types
parent
7156fd83f2
commit
7079afb906
|
|
@ -56,7 +56,7 @@ export type Notification = {
|
|||
}
|
||||
|
||||
export type Callbacks = {
|
||||
onStatusChange: (
|
||||
onStatusChange?: (
|
||||
env: any,
|
||||
monitor: any,
|
||||
isUp: boolean,
|
||||
|
|
@ -64,7 +64,7 @@ export type Callbacks = {
|
|||
timeNow: number,
|
||||
reason: string
|
||||
) => Promise<any>
|
||||
onIncident: (
|
||||
onIncident?: (
|
||||
env: any,
|
||||
monitor: any,
|
||||
timeIncidentStart: number,
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@ const Worker = {
|
|||
}
|
||||
|
||||
console.log('Calling config onStatusChange callback...')
|
||||
await workerConfig.callbacks?.onStatusChange(
|
||||
await workerConfig.callbacks?.onStatusChange?.(
|
||||
env,
|
||||
monitor,
|
||||
true,
|
||||
|
|
@ -250,7 +250,7 @@ const Worker = {
|
|||
|
||||
if (monitorStatusChanged) {
|
||||
console.log('Calling config onStatusChange callback...')
|
||||
await workerConfig.callbacks?.onStatusChange(
|
||||
await workerConfig.callbacks?.onStatusChange?.(
|
||||
env,
|
||||
monitor,
|
||||
false,
|
||||
|
|
@ -266,7 +266,7 @@ const Worker = {
|
|||
|
||||
try {
|
||||
console.log('Calling config onIncident callback...')
|
||||
await workerConfig.callbacks?.onIncident(
|
||||
await workerConfig.callbacks?.onIncident?.(
|
||||
env,
|
||||
monitor,
|
||||
currentIncident.start[0],
|
||||
|
|
|
|||
Loading…
Reference in New Issue