Skip to content

Commit

Permalink
Merge branch 'feat/typeorm-0.3-migration' of https://github.com/nestj…
Browse files Browse the repository at this point in the history
…s/typeorm into feat/typeorm-0.3-migration
  • Loading branch information
kamilmysliwiec committed Jun 1, 2022
2 parents 1f699cd + 3b14f13 commit d4ff918
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/typeorm-core.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ export class TypeOrmCoreModule implements OnApplicationShutdown {
getDataSourceToken(this.options as DataSourceOptions) as Type<DataSource>,
);
try {
dataSource && (await dataSource.destroy());
if (dataSource && dataSource.isInitialized) {
await dataSource.destroy();
}
} catch (e) {
this.logger.error(e?.message);
}
Expand Down

0 comments on commit d4ff918

Please sign in to comment.