mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-13 07:04:53 +09:00
Add missing updates to instance.updatedAt
Fix instances not properly updating their status to unassigned and unknown due to the updatedAt field not being updated with the current timestamp.
This commit is contained in:
1 parent
1e66f11917
commit
c3c2528c30
2 files changed
+3
No files matched your search
@@ -937,6 +937,7 @@ export default class Controller {
|
||||
);
|
||||
} else {
|
||||
instance.status = "unassigned";
|
||||
instance.updatedAt = Date.now();
|
||||
this.instanceDetailsUpdated([instance]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,6 +57,7 @@ export default class HostConnection extends BaseConnection {
|
||||
}
|
||||
|
||||
this.connector.on("close", () => {
|
||||
const now = Date.now();
|
||||
// Update status to unknown for instances on this host.
|
||||
const instances: InstanceInfo[] = [];
|
||||
for (let instance of this._controller.instances.values()) {
|
||||
@@ -67,6 +68,7 @@ export default class HostConnection extends BaseConnection {
|
||||
instances.push(instance);
|
||||
let prev = instance.status;
|
||||
instance.status = "unknown";
|
||||
instance.updatedAt = now;
|
||||
lib.invokeHook(this._controller.plugins, "onInstanceStatusChanged", instance, prev);
|
||||
}
|
||||
this._controller.instanceDetailsUpdated(instances);
|
||||
|
||||
Reference in new issue
Block a user