1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

fix: enabled lock check (#5997)

We should use the enhanced flagResolver
Tested locally:
```
9:44:13 AM - Starting compilation in watch mode...
[dev:backend] 
[dev:backend] 
[dev:backend] 9:44:26 AM - Found 0 errors. Watching for file changes.
[dev:backend] [2024-01-23T09:44:27.498] [INFO] server-impl.js - DB migration: start
[dev:backend] [2024-01-23T09:44:27.499] [INFO] server-impl.js - Running migration with lock
[dev:backend] [2024-01-23T09:44:29.884] [INFO] server-impl.js - DB migration: end
```
This commit is contained in:
Gastón Fournier 2024-01-23 10:46:48 +01:00 committed by GitHub
parent 48ef88b4fa
commit f63581c03a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -141,7 +141,7 @@ async function start(opts: IUnleashOptions = {}): Promise<IUnleash> {
logger.info('DB migration: disabled');
} else {
logger.info('DB migration: start');
if (opts.flagResolver?.isEnabled('migrationLock')) {
if (config.flagResolver.isEnabled('migrationLock')) {
logger.info('Running migration with lock');
const lock = withDbLock(config.db, {
lockKey: defaultLockKey,