1
0
Fork 0
mirror of synced 2024-08-05 13:21:26 +12:00

Updating logging for app migration.

This commit is contained in:
mike12345567 2024-06-07 18:31:40 +01:00
parent 17e62586c9
commit 67c6c156e3

View file

@ -20,8 +20,8 @@ export async function processMigrations(
resource: appId,
},
async () => {
try {
await context.doInAppMigrationContext(appId, async () => {
await context.doInAppMigrationContext(appId, async () => {
try {
let currentVersion = await getAppMigrationVersion(appId)
const pendingMigrations = migrations
@ -36,7 +36,9 @@ export async function processMigrations(
migrationIds[migrationIds.indexOf(currentVersion) + 1]
if (expectedMigration !== id) {
throw `Migration ${id} could not run, update for "${id}" is running but ${expectedMigration} is expected`
throw new Error(
`Migration ${id} could not run, update for "${id}" is running but ${expectedMigration} is expected`
)
}
const counter = `(${++index}/${pendingMigrations.length})`
@ -51,11 +53,11 @@ export async function processMigrations(
})
currentVersion = id
}
})
} catch (err) {
logging.logAlert("Failed to run app migration", err)
throw err
}
} catch (err) {
logging.logAlert("Failed to run app migration", err)
throw err
}
})
}
)