fix: datalake migration cosmetic fixes (#7281)

Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
Alexander Onnikov 2024-12-06 21:59:25 +07:00 committed by GitHub
parent 066c18cf13
commit 5f1535401f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 3 deletions

View File

@ -1213,11 +1213,12 @@ export function devTool (
throw new Error('Datalake storage config is required')
}
toolCtx.info('using datalake', { datalake: datalakeConfig })
const datalake = createDatalakeClient(datalakeConfig as DatalakeConfig)
let workspaces: Workspace[] = []
const { dbUrl } = prepareTools()
await withDatabase(dbUrl, async (db) => {
const accountUrl = getAccountDBUrl()
await withDatabase(accountUrl, async (db) => {
workspaces = await listWorkspacesPure(db)
workspaces = workspaces
.filter((p) => p.mode !== 'archived')

View File

@ -282,10 +282,19 @@ export async function copyToDatalake (
let time = Date.now()
let processedCnt = 0
let skippedCnt = 0
let failedCnt = 0
function printStats (): void {
const duration = Date.now() - time
console.log('...processed', processedCnt, 'skipped', skippedCnt, Math.round(duration / 1000) + 's')
console.log(
'...processed',
processedCnt,
'skipped',
skippedCnt,
'failed',
failedCnt,
Math.round(duration / 1000) + 's'
)
time = Date.now()
}
@ -319,6 +328,7 @@ export async function copyToDatalake (
)
} catch (err) {
console.error('failed to process blob', objectName, err)
failedCnt++
}
})
}