diff options
| author | Maze Winther <mazewinther@gmail.com> | 2026-02-05 14:44:31 +0100 |
|---|---|---|
| committer | Maze Winther <mazewinther@gmail.com> | 2026-02-05 14:44:31 +0100 |
| commit | 464a6e83b96a400614bea9973aeb0278d03daa0b (patch) | |
| tree | 9eaf84183913f8059f1a7d9ca589565b9e4d01be /apps/web/src/services/storage/migrations/v1-to-v2.ts | |
| parent | d0b4b1a5fc439d68371d8cfa677348250afec88b (diff) | |
| download | opencut-464a6e83b96a400614bea9973aeb0278d03daa0b.tar.gz | |
fix rendering issue from v1 to current
Diffstat (limited to 'apps/web/src/services/storage/migrations/v1-to-v2.ts')
| -rw-r--r-- | apps/web/src/services/storage/migrations/v1-to-v2.ts | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/apps/web/src/services/storage/migrations/v1-to-v2.ts b/apps/web/src/services/storage/migrations/v1-to-v2.ts index eff4397e..ef381541 100644 --- a/apps/web/src/services/storage/migrations/v1-to-v2.ts +++ b/apps/web/src/services/storage/migrations/v1-to-v2.ts @@ -33,8 +33,7 @@ export class V1toV2Migration extends StorageMigration { }); if (!result.skipped) { - // cleanup legacy timeline DBs after successful transformation - await cleanupLegacyTimelineDBs({ + void cleanupLegacyTimelineDBs({ projectId, project: result.project, }); @@ -60,13 +59,13 @@ function createMediaAssetLoader({ }; } -async function cleanupLegacyTimelineDBs({ +function cleanupLegacyTimelineDBs({ projectId, project, }: { projectId: string; project: ProjectRecord; -}): Promise<void> { +}): void { const scenes = project.scenes; if (!Array.isArray(scenes)) { return; @@ -89,11 +88,12 @@ async function cleanupLegacyTimelineDBs({ const projectDbName = `video-editor-timelines-${projectId}`; dbNamesToDelete.push(projectDbName); - for (const dbName of dbNamesToDelete) { - try { - await deleteDatabase({ dbName }); - } catch { - // ignore errors, DB might not exist or already deleted - } - } + // Fire-and-forget: delete in parallel, don't block migration + void Promise.all( + dbNamesToDelete.map((dbName) => + deleteDatabase({ dbName }).catch(() => { + // ignore errors, DB might not exist or already deleted + }), + ), + ); } |
