Merge pull request #13905 from Budibase/fix/app-migration-full-logging
App migration - make sure any issue is logged
This commit is contained in:
commit
2c83363d25
|
@ -12,16 +12,16 @@ export async function processMigrations(
|
||||||
migrations: AppMigration[]
|
migrations: AppMigration[]
|
||||||
) {
|
) {
|
||||||
console.log(`Processing app migration for "${appId}"`)
|
console.log(`Processing app migration for "${appId}"`)
|
||||||
// have to wrap in context, this gets the tenant from the app ID
|
try {
|
||||||
await context.doInAppContext(appId, async () => {
|
// have to wrap in context, this gets the tenant from the app ID
|
||||||
await locks.doWithLock(
|
await context.doInAppContext(appId, async () => {
|
||||||
{
|
await locks.doWithLock(
|
||||||
name: LockName.APP_MIGRATION,
|
{
|
||||||
type: LockType.AUTO_EXTEND,
|
name: LockName.APP_MIGRATION,
|
||||||
resource: appId,
|
type: LockType.AUTO_EXTEND,
|
||||||
},
|
resource: appId,
|
||||||
async () => {
|
},
|
||||||
try {
|
async () => {
|
||||||
await context.doInAppMigrationContext(appId, async () => {
|
await context.doInAppMigrationContext(appId, async () => {
|
||||||
let currentVersion = await getAppMigrationVersion(appId)
|
let currentVersion = await getAppMigrationVersion(appId)
|
||||||
|
|
||||||
|
@ -55,13 +55,13 @@ export async function processMigrations(
|
||||||
currentVersion = id
|
currentVersion = id
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} catch (err) {
|
|
||||||
logging.logAlert("Failed to run app migration", err)
|
|
||||||
throw err
|
|
||||||
}
|
}
|
||||||
}
|
)
|
||||||
)
|
|
||||||
|
|
||||||
console.log(`App migration for "${appId}" processed`)
|
console.log(`App migration for "${appId}" processed`)
|
||||||
})
|
})
|
||||||
|
} catch (err) {
|
||||||
|
logging.logAlert("Failed to run app migration", err)
|
||||||
|
throw err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue