Merge pull request #2632 from chakflying/fix/docker-timeout

Fix: Use default timeout & CachebleDnsHttpsAgent for docker monitor
pull/2651/head
Louis Lam 2 years ago committed by GitHub
commit 6ccf741bc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -495,14 +495,18 @@ class Monitor extends BeanModel {
const options = { const options = {
url: `/containers/${this.docker_container}/json`, url: `/containers/${this.docker_container}/json`,
timeout: this.interval * 1000 * 0.8,
headers: { headers: {
"Accept": "*/*", "Accept": "*/*",
"User-Agent": "Uptime-Kuma/" + version, "User-Agent": "Uptime-Kuma/" + version,
}, },
httpsAgent: new https.Agent({ httpsAgent: CacheableDnsHttpAgent.getHttpsAgent({
maxCachedSessions: 0, // Use Custom agent to disable session reuse (https://github.com/nodejs/node/issues/3940) maxCachedSessions: 0, // Use Custom agent to disable session reuse (https://github.com/nodejs/node/issues/3940)
rejectUnauthorized: !this.getIgnoreTls(), rejectUnauthorized: !this.getIgnoreTls(),
}), }),
httpAgent: CacheableDnsHttpAgent.getHttpAgent({
maxCachedSessions: 0,
}),
}; };
if (dockerHost._dockerType === "socket") { if (dockerHost._dockerType === "socket") {

Loading…
Cancel
Save