mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-13 23:14:53 +09:00
Skip gatherng metrics from dropped slaves
Avoid stacking up huge amounts of metrics requests while a slave connection is in the dropped state.
This commit is contained in:
1 parent
3b6ebeb653
commit
e5582b5558
1 file changed
+3
@@ -48,6 +48,9 @@ async function getMetrics(req, res, next) {
|
||||
let requests = [];
|
||||
let timeout = req.app.locals.master.config.get("master.metrics_timeout") * 1000;
|
||||
for (let slaveConnection of req.app.locals.master.wsServer.slaveConnections.values()) {
|
||||
if (!slaveConnection.connected) {
|
||||
continue;
|
||||
}
|
||||
requests.push(libHelpers.timeout(
|
||||
libLink.messages.getMetrics.send(slaveConnection).catch(err => {
|
||||
if (!(err instanceof libErrors.SessionLost)) {
|
||||
|
||||
Reference in new issue
Block a user