refactor: improve monitor retry logic. make sure send notice when retried
This commit is contained in:
parent
a73720411c
commit
ffee0b8799
@ -63,6 +63,8 @@ export class MonitorRunner {
|
||||
// can be retry
|
||||
this.retriedNum++;
|
||||
} else {
|
||||
this.retriedNum = 0; // make sure its will throw error in every retry times
|
||||
|
||||
// check event update
|
||||
if (value < 0 && currentStatus === 'UP') {
|
||||
// UP -> DOWN
|
||||
@ -80,7 +82,6 @@ export class MonitorRunner {
|
||||
currentStatus = 'DOWN';
|
||||
} else if (value > 0 && currentStatus === 'DOWN') {
|
||||
// DOWN -> UP
|
||||
this.retriedNum = 0;
|
||||
await this.createEvent(
|
||||
'UP',
|
||||
`Monitor [${monitor.name}] has been up`
|
||||
|
Loading…
x
Reference in New Issue
Block a user