mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-12-24 23:09:39 -05:00
prevent all monitors making requests at the same moment when start the server
This commit is contained in:
parent
30b8d3d0ab
commit
209e44c2e1
@ -755,9 +755,11 @@ async function startMonitors() {
|
|||||||
let list = await R.find("monitor", " active = 1 ")
|
let list = await R.find("monitor", " active = 1 ")
|
||||||
|
|
||||||
for (let monitor of list) {
|
for (let monitor of list) {
|
||||||
monitor.start(io);
|
|
||||||
monitorList[monitor.id] = monitor;
|
monitorList[monitor.id] = monitor;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let monitor of list) {
|
||||||
|
monitor.start(io);
|
||||||
// Give some delays, so all monitors won't make request at the same moment when just start the server.
|
// Give some delays, so all monitors won't make request at the same moment when just start the server.
|
||||||
await sleep(getRandomInt(300, 1000));
|
await sleep(getRandomInt(300, 1000));
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,11 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
shortBeatList() {
|
shortBeatList() {
|
||||||
let placeholders = []
|
if (! this.beatList) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
let placeholders = [];
|
||||||
|
|
||||||
let start = this.beatList.length - this.maxBeat;
|
let start = this.beatList.length - this.maxBeat;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user