mirror of
https://github.com/hcengineering/platform.git
synced 2025-05-11 01:40:32 +00:00
Fix backup all and disable full check for migration
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
cc0cb34ba6
commit
88813b5e5b
@ -787,7 +787,12 @@ export function devTool (
|
||||
const skipped = new Set(cmd.skip.split(',').map((it) => it.trim()))
|
||||
await withAccountDatabase(async (db) => {
|
||||
const workspaces = (await listWorkspacesPure(db))
|
||||
.sort((a, b) => a.lastVisit - b.lastVisit)
|
||||
.sort((a, b) => {
|
||||
const bsize = b.backupInfo?.backupSize ?? 0
|
||||
const asize = a.backupInfo?.backupSize ?? 0
|
||||
return bsize - asize
|
||||
})
|
||||
.filter((it) => isActiveMode(it.mode))
|
||||
.filter((it) => (cmd.workspace === '' || cmd.workspace === it.workspace) && !skipped.has(it.workspace))
|
||||
|
||||
let processed = 0
|
||||
|
@ -450,7 +450,7 @@ export class WorkspaceWorker {
|
||||
await sendEvent('archiving-backup-started', 0)
|
||||
|
||||
await this.sendTransactorMaitenance(token, { name: workspace.workspace })
|
||||
if (await this.doBackup(ctx, workspace, opt)) {
|
||||
if (await this.doBackup(ctx, workspace, opt, true)) {
|
||||
await sendEvent('archiving-backup-done', 100)
|
||||
}
|
||||
break
|
||||
@ -487,7 +487,7 @@ export class WorkspaceWorker {
|
||||
case 'migration-backup':
|
||||
await sendEvent('migrate-backup-started', 0)
|
||||
await this.sendTransactorMaitenance(token, { name: workspace.workspace })
|
||||
if (await this.doBackup(ctx, workspace, opt)) {
|
||||
if (await this.doBackup(ctx, workspace, opt, false)) {
|
||||
await sendEvent('migrate-backup-done', 100)
|
||||
}
|
||||
break
|
||||
@ -522,7 +522,12 @@ export class WorkspaceWorker {
|
||||
}
|
||||
}
|
||||
|
||||
private async doBackup (ctx: MeasureContext, workspace: BaseWorkspaceInfo, opt: WorkspaceOptions): Promise<boolean> {
|
||||
private async doBackup (
|
||||
ctx: MeasureContext,
|
||||
workspace: BaseWorkspaceInfo,
|
||||
opt: WorkspaceOptions,
|
||||
doFullCheck: boolean
|
||||
): Promise<boolean> {
|
||||
if (opt.backup === undefined) {
|
||||
return false
|
||||
}
|
||||
@ -583,7 +588,7 @@ export class WorkspaceWorker {
|
||||
50000,
|
||||
['blob'],
|
||||
sharedPipelineContextVars,
|
||||
true, // Do a full check
|
||||
doFullCheck, // Do full check based on config, do not do for migration, it is to slow, will perform before migration.
|
||||
(_p: number) => {
|
||||
if (progress !== Math.round(_p)) {
|
||||
progress = Math.round(_p)
|
||||
|
Loading…
Reference in New Issue
Block a user