mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-16 23:30:41 +09:00
Cache save details on the controller
Keep a copy of the instance saves details on the controller so that saves can be queried even when the host is disconnected and the controller can properly track and provide updates on the saves to its clients.
This commit is contained in:
1 parent
d186f85773
commit
a2914bda33
13 files changed
+219
-66
No files matched your search
@@ -532,7 +532,8 @@ instanceSaveCommands.add(new lib.Command({
|
||||
}],
|
||||
handler: async function(args: { instance: string }, control: Control) {
|
||||
let instanceId = await lib.resolveInstance(control, args.instance);
|
||||
let saves = await control.sendTo({ instanceId }, new lib.InstanceListSavesRequest());
|
||||
let saves = await control.sendTo("controller", new lib.InstanceSaveDetailsListRequest());
|
||||
saves = saves.filter(save => save.instanceId === instanceId);
|
||||
print(asTable(saves.map(
|
||||
({ mtimeMs, ...rest }) => ({ ...rest, mtime: new Date(mtimeMs).toLocaleString() })
|
||||
)));
|
||||
|
||||
Reference in new issue
Block a user