From 3dcce65c9c7cd8c26851db8d25a218a3affb28dd Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 13 Jun 2024 17:50:07 +0100 Subject: [PATCH] revert. --- .../server/src/appMigrations/appMigrationMetadata.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/server/src/appMigrations/appMigrationMetadata.ts b/packages/server/src/appMigrations/appMigrationMetadata.ts index fb3310619e..1662a6f225 100644 --- a/packages/server/src/appMigrations/appMigrationMetadata.ts +++ b/packages/server/src/appMigrations/appMigrationMetadata.ts @@ -23,15 +23,16 @@ const getCacheKey = (appId: string) => `appmigrations_${env.VERSION}_${appId}` export async function getAppMigrationVersion(appId: string): Promise { const cacheKey = getCacheKey(appId) - let version: string | undefined = await cache.get(cacheKey) + let metadata: AppMigrationDoc | undefined = await cache.get(cacheKey) // returned cached version if we found one - if (version) { - return version + if (metadata?.version) { + return metadata.version } + let version try { - const metadata = await getFromDB(appId) + metadata = await getFromDB(appId) version = metadata.version || "" } catch (err: any) { if (err.status !== 404) {