diff --git a/dev/tool/src/index.ts b/dev/tool/src/index.ts index 655292ffb1..90d5e97aaa 100644 --- a/dev/tool/src/index.ts +++ b/dev/tool/src/index.ts @@ -524,7 +524,8 @@ export function devTool ( await updateWorkspace(db, info, { mode: 'active', progress: 100, - version + version, + attempts: 0 }) console.log(metricsToString(measureCtx.metrics, 'upgrade', 60)) @@ -572,7 +573,8 @@ export function devTool ( await updateWorkspace(db, ws, { mode: 'active', progress: 100, - version + version, + attempts: 0 }) } catch (err: any) { console.error(err) @@ -1589,6 +1591,25 @@ export function devTool ( }) }) + program + .command('reset-ws-attempts ') + .description('Reset workspace creation/upgrade attempts counter') + .action(async (workspace) => { + const { mongodbUri } = prepareTools() + await withDatabase(mongodbUri, async (db) => { + const info = await getWorkspaceById(db, workspace) + if (info === null) { + throw new Error(`workspace ${workspace} not found`) + } + + await updateWorkspace(db, info, { + attempts: 0 + }) + + console.log('Attempts counter for workspace', workspace, 'has been reset') + }) + }) + extendProgram?.(program) program.parse(process.argv)