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:
Hornwitser committed 2023-12-11 20:21:43 +01:00
1 parent d186f85773
commit a2914bda33
13 files changed
+219 -66

No files matched your search

+2 -1
View File
@@ -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() })
)));