1
0
Fork 0
mirror of synced 2024-07-13 02:05:54 +12:00

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

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