From 585bbefb90cbd6173fb9683540458124d0d09b42 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 12 Jun 2024 15:04:18 +0100 Subject: [PATCH 1/2] Moving app migrations back to the automation service now that its getting updated in QA - also making sure that the app migration is always cached, disabling it in dev/QA may hide issues with caching, making sure it always runs the same as it does in prod is safest. --- packages/server/src/appMigrations/appMigrationMetadata.ts | 4 ++-- packages/server/src/startup/index.ts | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/server/src/appMigrations/appMigrationMetadata.ts b/packages/server/src/appMigrations/appMigrationMetadata.ts index 971dde1e7a..1662a6f225 100644 --- a/packages/server/src/appMigrations/appMigrationMetadata.ts +++ b/packages/server/src/appMigrations/appMigrationMetadata.ts @@ -25,8 +25,8 @@ export async function getAppMigrationVersion(appId: string): Promise { let metadata: AppMigrationDoc | undefined = await cache.get(cacheKey) - // We don't want to cache in dev or QA in order to be able to tweak it - if (metadata && !env.isDev() && !env.isQA()) { + // returned cached version if we found one + if (metadata?.version) { return metadata.version } diff --git a/packages/server/src/startup/index.ts b/packages/server/src/startup/index.ts index 0e08075698..83d92443c6 100644 --- a/packages/server/src/startup/index.ts +++ b/packages/server/src/startup/index.ts @@ -121,8 +121,6 @@ export async function startup( // app migrations and automations on other service if (automationsEnabled()) { queuePromises.push(automations.init()) - } - if (apiEnabled()) { queuePromises.push(appMigrations.init()) } queuePromises.push(initPro()) From bf75d9da80f18d8e13af1c061918ffd2531de0c0 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 12 Jun 2024 15:21:00 +0100 Subject: [PATCH 2/2] Fix lint. --- packages/server/src/startup/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/startup/index.ts b/packages/server/src/startup/index.ts index 83d92443c6..c86b0eb264 100644 --- a/packages/server/src/startup/index.ts +++ b/packages/server/src/startup/index.ts @@ -20,7 +20,7 @@ import * as pro from "@budibase/pro" import * as api from "../api" import sdk from "../sdk" import { initialise as initialiseWebsockets } from "../websockets" -import { apiEnabled, automationsEnabled, printFeatures } from "../features" +import { automationsEnabled, printFeatures } from "../features" import * as jsRunner from "../jsRunner" import Koa from "koa" import { Server } from "http"