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

chore: add logs (#5996)

Validate we're not using locks
This commit is contained in:
Gastón Fournier 2024-01-23 10:24:58 +01:00 committed by GitHub
parent 3fd735ac7e
commit 0b1d565dad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -140,7 +140,7 @@ async function start(opts: IUnleashOptions = {}): Promise<IUnleash> {
if (config.db.disableMigration) {
logger.info('DB migration: disabled');
} else {
logger.debug('DB migration: start');
logger.info('DB migration: start');
if (opts.flagResolver?.isEnabled('migrationLock')) {
logger.info('Running migration with lock');
const lock = withDbLock(config.db, {
@ -150,10 +150,11 @@ async function start(opts: IUnleashOptions = {}): Promise<IUnleash> {
});
await lock(migrateDb)(config);
} else {
logger.info('Running migration without lock');
await migrateDb(config);
}
logger.debug('DB migration: end');
logger.info('DB migration: end');
}
} catch (err) {
logger.error('Failed to migrate db', err);