From d3ffb3c2fd57f7a2db53f19b74a2c7af2aa35bb3 Mon Sep 17 00:00:00 2001 From: Andrey Sobolev Date: Tue, 18 Mar 2025 00:38:12 +0700 Subject: [PATCH] Fix backup-all script (#8255) Signed-off-by: Andrey Sobolev --- dev/tool/src/index.ts | 4 +++- server/backup/src/backup.ts | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/dev/tool/src/index.ts b/dev/tool/src/index.ts index 0393fa93bb..898533dfd1 100644 --- a/dev/tool/src/index.ts +++ b/dev/tool/src/index.ts @@ -1010,7 +1010,9 @@ export function devTool ( const skipWorkspaces = new Set(cmd.skip.split(',').map((it) => it.trim())) - const token = generateToken(systemAccountUuid, '' as WorkspaceUuid) + const token = generateToken(systemAccountUuid, '' as WorkspaceUuid, { + service: 'tool' + }) const workspaces = (await getAccountClient(token).listWorkspaces(cmd.region)) .sort((a, b) => { const bsize = b.backupInfo?.backupSize ?? 0 diff --git a/server/backup/src/backup.ts b/server/backup/src/backup.ts index a84fa71718..5ec23d9a43 100644 --- a/server/backup/src/backup.ts +++ b/server/backup/src/backup.ts @@ -2810,6 +2810,13 @@ export async function checkBackupIntegrity (ctx: MeasureContext, storage: Backup modified = true } } + if (backupInfo.migrations == null) { + backupInfo.migrations = {} + } + if (!backupInfo.migrations.zeroCheckSize) { + backupInfo.migrations.zeroCheckSize = true + modified = true + } if (modified) { await storage.writeFile(infoFile, gzipSync(JSON.stringify(backupInfo, undefined, 2), { level: defaultLevel })) }