Skip to content

Commit

Permalink
Log the async migration status on initialization rather than on import
Browse files Browse the repository at this point in the history
Change-type: patch
  • Loading branch information
Page- committed Dec 30, 2024
1 parent e47a73e commit 4d84720
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/migrator/async.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,6 @@ import {
} from './utils';
import { booleanToEnabledString } from '../config-loader/env';

// log the startup condition of the async migration
(sbvrUtils.logger?.migrations?.info ?? console.info)(
`Async migration execution is ${booleanToEnabledString(
migratorEnv.asyncMigrationIsEnabled,
)}`,
);

export const run = async (tx: Tx, model: ApiRootModel): Promise<void> => {
const { migrations } = model;
if (migrations == null || _.isEmpty(migrations)) {
Expand Down Expand Up @@ -188,6 +181,13 @@ const $run = async (
// created. When the transaction fails, the setup async migration entries in the DB will be
// rolled back automatically.
setupTx.on('end', () => {
// log the startup condition of the async migration
(sbvrUtils.logger?.migrations?.info ?? console.info)(
`Async migration execution is ${booleanToEnabledString(
migratorEnv.asyncMigrationIsEnabled,
)}`,
);

for (const {
key,
initMigrationState,
Expand Down

0 comments on commit 4d84720

Please sign in to comment.