mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-06 23:17:28 +08:00
Data migration and history retention for 2.0.0 (#5075)
This commit is contained in:
@@ -1604,18 +1604,20 @@ let needSetup = false;
|
||||
|
||||
await server.start();
|
||||
|
||||
server.httpServer.listen(port, hostname, () => {
|
||||
server.httpServer.listen(port, hostname, async () => {
|
||||
if (hostname) {
|
||||
log.info("server", `Listening on ${hostname}:${port}`);
|
||||
} else {
|
||||
log.info("server", `Listening on ${port}`);
|
||||
}
|
||||
startMonitors();
|
||||
await startMonitors();
|
||||
|
||||
// Put this here. Start background jobs after the db and server is ready to prevent clear up during db migration.
|
||||
await initBackgroundJobs();
|
||||
|
||||
checkVersion.startInterval();
|
||||
});
|
||||
|
||||
await initBackgroundJobs();
|
||||
|
||||
// Start cloudflared at the end if configured
|
||||
await cloudflaredAutoStart(cloudflaredToken);
|
||||
|
||||
@@ -1809,7 +1811,11 @@ async function startMonitors() {
|
||||
}
|
||||
|
||||
for (let monitor of list) {
|
||||
await monitor.start(io);
|
||||
try {
|
||||
await monitor.start(io);
|
||||
} catch (e) {
|
||||
log.error("monitor", e);
|
||||
}
|
||||
// Give some delays, so all monitors won't make request at the same moment when just start the server.
|
||||
await sleep(getRandomInt(300, 1000));
|
||||
}
|
||||
|
Reference in New Issue
Block a user