mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-23 14:54:05 +00:00
poc done
This commit is contained in:
parent
65ff08b38e
commit
a16b42f98c
1 changed files with 5 additions and 1 deletions
|
@ -606,7 +606,9 @@ class Monitor extends BeanModel {
|
||||||
if (result.toString() === this.expectedValue) {
|
if (result.toString() === this.expectedValue) {
|
||||||
bean.msg += ", expected value is found";
|
bean.msg += ", expected value is found";
|
||||||
bean.status = UP;
|
bean.status = UP;
|
||||||
|
console.log('json-query successful')
|
||||||
} else {
|
} else {
|
||||||
|
console.log('json-query unsuccessful')
|
||||||
throw new Error(bean.msg + ", but value is not equal to expected value, value was: [" + result + "]");
|
throw new Error(bean.msg + ", but value is not equal to expected value, value was: [" + result + "]");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -898,7 +900,7 @@ class Monitor extends BeanModel {
|
||||||
retries = 0;
|
retries = 0;
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
console.log('came in catch')
|
||||||
if (error?.name === "CanceledError") {
|
if (error?.name === "CanceledError") {
|
||||||
bean.msg = `timeout by AbortSignal (${this.timeout}s)`;
|
bean.msg = `timeout by AbortSignal (${this.timeout}s)`;
|
||||||
} else {
|
} else {
|
||||||
|
@ -913,6 +915,7 @@ class Monitor extends BeanModel {
|
||||||
} else if ((this.maxretries > 0) && (retries < this.maxretries)) {
|
} else if ((this.maxretries > 0) && (retries < this.maxretries)) {
|
||||||
retries++;
|
retries++;
|
||||||
bean.status = PENDING;
|
bean.status = PENDING;
|
||||||
|
console.log('checking retries', retries, this.maxretries)
|
||||||
} else {
|
} else {
|
||||||
// Continue counting retries during DOWN
|
// Continue counting retries during DOWN
|
||||||
retries++;
|
retries++;
|
||||||
|
@ -971,6 +974,7 @@ class Monitor extends BeanModel {
|
||||||
} else if (bean.status === MAINTENANCE) {
|
} else if (bean.status === MAINTENANCE) {
|
||||||
log.warn("monitor", `Monitor #${this.id} '${this.name}': Under Maintenance | Type: ${this.type}`);
|
log.warn("monitor", `Monitor #${this.id} '${this.name}': Under Maintenance | Type: ${this.type}`);
|
||||||
} else {
|
} else {
|
||||||
|
beatInterval = this.retryInterval
|
||||||
log.warn("monitor", `Monitor #${this.id} '${this.name}': Failing: ${bean.msg} | Interval: ${beatInterval} seconds | Type: ${this.type} | Down Count: ${bean.downCount} | Resend Interval: ${this.resendInterval}`);
|
log.warn("monitor", `Monitor #${this.id} '${this.name}': Failing: ${bean.msg} | Interval: ${beatInterval} seconds | Type: ${this.type} | Down Count: ${bean.downCount} | Resend Interval: ${this.resendInterval}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue