Merge pull request #13907 from Budibase/fix/app-migrations-api-service
App migrations in API service
This commit is contained in:
commit
26c2904f51
1 changed files with 6 additions and 1 deletions
|
@ -2,6 +2,7 @@ import { queue, logging } from "@budibase/backend-core"
|
||||||
import { Job } from "bull"
|
import { Job } from "bull"
|
||||||
import { MIGRATIONS } from "./migrations"
|
import { MIGRATIONS } from "./migrations"
|
||||||
import { processMigrations } from "./migrationsProcessor"
|
import { processMigrations } from "./migrationsProcessor"
|
||||||
|
import { apiEnabled } from "../features"
|
||||||
|
|
||||||
const MAX_ATTEMPTS = 3
|
const MAX_ATTEMPTS = 3
|
||||||
|
|
||||||
|
@ -18,7 +19,11 @@ const appMigrationQueue = queue.createQueue(queue.JobQueue.APP_MIGRATION, {
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// only run app migrations in main API services
|
||||||
|
if (apiEnabled()) {
|
||||||
appMigrationQueue.process(processMessage)
|
appMigrationQueue.process(processMessage)
|
||||||
|
}
|
||||||
|
|
||||||
async function processMessage(job: Job) {
|
async function processMessage(job: Job) {
|
||||||
const { appId } = job.data
|
const { appId } = job.data
|
||||||
|
|
Loading…
Reference in a new issue