Only run app migrations in API service - testing this in QA.

This commit is contained in:
mike12345567 2024-06-10 20:46:08 +01:00
parent 834de1f64a
commit 1a0d6ef5b0
1 changed files with 6 additions and 1 deletions

View File

@ -2,6 +2,7 @@ import { queue, logging } from "@budibase/backend-core"
import { Job } from "bull"
import { MIGRATIONS } from "./migrations"
import { processMigrations } from "./migrationsProcessor"
import { apiEnabled } from "../features"
const MAX_ATTEMPTS = 3
@ -18,7 +19,11 @@ const appMigrationQueue = queue.createQueue(queue.JobQueue.APP_MIGRATION, {
)
},
})
appMigrationQueue.process(processMessage)
// only run app migrations in main API services
if (apiEnabled()) {
appMigrationQueue.process(processMessage)
}
async function processMessage(job: Job) {
const { appId } = job.data