From 5b4848007bdbf51e1b528e0a01f63b6f0846e653 Mon Sep 17 00:00:00 2001 From: Gitar Date: Mon, 19 Aug 2024 17:10:58 +0000 Subject: [PATCH] [Gitar] Updating TypeScript files --- src/lib/__snapshots__/create-config.test.ts.snap | 1 - src/lib/server-impl.ts | 15 ++------------- src/lib/types/experimental.ts | 2 -- 3 files changed, 2 insertions(+), 16 deletions(-) diff --git a/src/lib/__snapshots__/create-config.test.ts.snap b/src/lib/__snapshots__/create-config.test.ts.snap index d5f1617b9b68..8474084feb3e 100644 --- a/src/lib/__snapshots__/create-config.test.ts.snap +++ b/src/lib/__snapshots__/create-config.test.ts.snap @@ -134,7 +134,6 @@ exports[`should create default config 1`] = ` "value": "", }, }, - "migrationLock": true, "navigationSidebar": true, "newEventSearch": false, "originMiddleware": false, diff --git a/src/lib/server-impl.ts b/src/lib/server-impl.ts index 4a596e17e51d..844bd177b1a8 100644 --- a/src/lib/server-impl.ts +++ b/src/lib/server-impl.ts @@ -32,7 +32,6 @@ import { Knex } from 'knex'; import * as permissions from './types/permissions'; import * as eventType from './types/events'; import { Db } from './db/db'; -import { defaultLockKey, defaultTimeout, withDbLock } from './util/db-lock'; import { scheduleServices } from './features/scheduler/schedule-services'; import { compareAndLogPostgresVersion } from './util/postgres-version-checker'; @@ -147,18 +146,8 @@ async function start(opts: IUnleashOptions = {}): Promise { logger.info('DB migration: disabled'); } else { logger.info('DB migration: start'); - if (config.flagResolver.isEnabled('migrationLock')) { - logger.info('Running migration with lock'); - const lock = withDbLock(config.db, { - lockKey: defaultLockKey, - timeout: defaultTimeout, - logger, - }); - await lock(migrateDb)(config); - } else { - logger.info('Running migration without lock'); - await migrateDb(config); - } + logger.info('Running migration without lock'); + await migrateDb(config); logger.info('DB migration: end'); } diff --git a/src/lib/types/experimental.ts b/src/lib/types/experimental.ts index e6df34fecd5a..7cb39444292b 100644 --- a/src/lib/types/experimental.ts +++ b/src/lib/types/experimental.ts @@ -17,7 +17,6 @@ export type IFlagKey = | 'caseInsensitiveInOperators' | 'strictSchemaValidation' | 'personalAccessTokensKillSwitch' - | 'migrationLock' | 'demo' | 'googleAuthEnabled' | 'disableBulkToggle' @@ -119,7 +118,6 @@ const flags: IFlags = { process.env.UNLEASH_PAT_KILL_SWITCH, false, ), - migrationLock: parseEnvVarBoolean(process.env.MIGRATION_LOCK, true), demo: parseEnvVarBoolean(process.env.UNLEASH_DEMO, false), googleAuthEnabled: parseEnvVarBoolean( process.env.GOOGLE_AUTH_ENABLED,