mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-22 19:11:33 +03:00
fix: datalake migration cosmetic fixes (#7281)
Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
parent
066c18cf13
commit
5f1535401f
@ -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')
|
||||
|
@ -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++
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user