From 585bbefb90cbd6173fb9683540458124d0d09b42 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 12 Jun 2024 15:04:18 +0100 Subject: [PATCH] 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())