Log every step of the app migration process for easier visibility.
This commit is contained in:
parent
7d28dbd4c8
commit
834de1f64a
|
@ -15,6 +15,7 @@ export async function processMigrations(
|
||||||
try {
|
try {
|
||||||
// have to wrap in context, this gets the tenant from the app ID
|
// have to wrap in context, this gets the tenant from the app ID
|
||||||
await context.doInAppContext(appId, async () => {
|
await context.doInAppContext(appId, async () => {
|
||||||
|
console.log(`Acquiring app migration lock for "${appId}"`)
|
||||||
await locks.doWithLock(
|
await locks.doWithLock(
|
||||||
{
|
{
|
||||||
name: LockName.APP_MIGRATION,
|
name: LockName.APP_MIGRATION,
|
||||||
|
@ -23,6 +24,7 @@ export async function processMigrations(
|
||||||
},
|
},
|
||||||
async () => {
|
async () => {
|
||||||
await context.doInAppMigrationContext(appId, async () => {
|
await context.doInAppMigrationContext(appId, async () => {
|
||||||
|
console.log(`Lock acquired starting app migration for "${appId}"`)
|
||||||
let currentVersion = await getAppMigrationVersion(appId)
|
let currentVersion = await getAppMigrationVersion(appId)
|
||||||
|
|
||||||
const pendingMigrations = migrations
|
const pendingMigrations = migrations
|
||||||
|
@ -30,6 +32,9 @@ export async function processMigrations(
|
||||||
.sort((a, b) => a.id.localeCompare(b.id))
|
.sort((a, b) => a.id.localeCompare(b.id))
|
||||||
|
|
||||||
const migrationIds = migrations.map(m => m.id).sort()
|
const migrationIds = migrations.map(m => m.id).sort()
|
||||||
|
console.log(
|
||||||
|
`App migrations to run for "${appId}" - ${migrationIds.join(",")}`
|
||||||
|
)
|
||||||
|
|
||||||
let index = 0
|
let index = 0
|
||||||
for (const { id, func } of pendingMigrations) {
|
for (const { id, func } of pendingMigrations) {
|
||||||
|
|
Loading…
Reference in New Issue