mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-15 07:24:52 +09:00
Ignore instance status changes that didn't change
Check if the instance status in the instanceStatusChanged event actually changed and ignore the event if it didn't. This prevents bogus updates from being pushed to control clients and plugins.
This commit is contained in:
1 parent
6ffcb8c451
commit
177278fee3
1 file changed
+9
@@ -62,6 +62,15 @@ class SlaveConnection extends BaseConnection {
|
||||
return;
|
||||
}
|
||||
|
||||
// We may receive status changed where the status hasn't changed
|
||||
// from our perspective if the connection was down at the time it
|
||||
// changed. Slaves also send status updates on assignInstance which
|
||||
// for hacky reason is also used to push config changes and
|
||||
// restablish status after a connection loss.
|
||||
if (instance.status === message.data.status) {
|
||||
return;
|
||||
}
|
||||
|
||||
let prev = instance.status;
|
||||
instance.status = message.data.status;
|
||||
logger.verbose(`Instance ${instance.config.get("instance.name")} State: ${instance.status}`);
|
||||
|
||||
Reference in new issue
Block a user