Skip to content

Commit

Permalink
chore(alert-receiver): adjust defaults (#903)
Browse files Browse the repository at this point in the history
  • Loading branch information
Thrimbda authored Nov 13, 2024
1 parent e0d2c77 commit de445f9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
10 changes: 7 additions & 3 deletions apps/alert-receiver/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
bindNodeCallback,
catchError,
defer,
delay,
EMPTY,
filter,
first,
Expand Down Expand Up @@ -211,9 +212,9 @@ defer(() => keepAliveSignal$.pipe(first()))
tap(() => {
console.info(formatTime(Date.now()), 'WatchdogReceived');
}),
timeout(10 * 60_000),
timeout(5 * 60_000),
catchError((e) => {
console.error(formatTime(Date.now()), 'WatchdogFailed', '超过 600 秒没有收到 Watchdog');
console.error(formatTime(Date.now()), 'WatchdogFailed', '超过 300 秒没有收到 Watchdog');
const alert: IAlertGroup = {
name: 'WatchdogFailed',
// TODO: read from alertmanager
Expand All @@ -230,7 +231,10 @@ defer(() => keepAliveSignal$.pipe(first()))
},
],
};
return sendAlert(alert);
return sendAlert(alert).pipe(
// cool down for 30 minutes
delay(30 * 60_000),
);
}),
repeat(),
)
Expand Down
10 changes: 10 additions & 0 deletions common/changes/@yuants/app-alert-receiver/2024-11-13-13-47.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@yuants/app-alert-receiver",
"comment": "chore: update default",
"type": "patch"
}
],
"packageName": "@yuants/app-alert-receiver"
}

0 comments on commit de445f9

Please sign in to comment.