From e12a03d05f8464dde746fd7b0c73517f05549259 Mon Sep 17 00:00:00 2001 From: Michael Drury Date: Sat, 24 Sep 2022 16:55:22 +0100 Subject: [PATCH] PR comments. --- .../server/src/migrations/functions/pluginCount.ts | 5 ----- packages/server/src/migrations/index.ts | 14 ++++++++------ 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/packages/server/src/migrations/functions/pluginCount.ts b/packages/server/src/migrations/functions/pluginCount.ts index 873a0967f8..a9dff9d7c8 100644 --- a/packages/server/src/migrations/functions/pluginCount.ts +++ b/packages/server/src/migrations/functions/pluginCount.ts @@ -1,12 +1,7 @@ import { tenancy, logging } from "@budibase/backend-core" import { plugins } from "@budibase/pro" -import env from "../../environment" export const run = async () => { - // only a self hosted op - if (!env.SELF_HOSTED) { - return - } try { await tenancy.doInTenant(tenancy.DEFAULT_TENANT_ID, async () => { await plugins.checkPluginQuotas() diff --git a/packages/server/src/migrations/index.ts b/packages/server/src/migrations/index.ts index 0e60df546f..8fcdf1e311 100644 --- a/packages/server/src/migrations/index.ts +++ b/packages/server/src/migrations/index.ts @@ -70,12 +70,14 @@ export const buildMigrations = () => { break } case MigrationName.PLUGIN_COUNT: { - serverMigrations.push({ - ...definition, - fn: pluginCount.run, - silent: !!env.SELF_HOSTED, - preventRetry: false, - }) + if (env.SELF_HOSTED) { + serverMigrations.push({ + ...definition, + fn: pluginCount.run, + silent: !!env.SELF_HOSTED, + preventRetry: false, + }) + } } } }