From 0a202f30e1ff2037e43605e90abb3ea1fc7cc271 Mon Sep 17 00:00:00 2001 From: Xzas22 <37516851+Xzas22@users.noreply.github.com> Date: Wed, 30 Jun 2021 09:13:35 -0400 Subject: [PATCH] Set ConnectionManager as global in Container Fixes scoped containerInstance.get requests for ConnectionManager, which was previously creating a cloned ConnectionManager via new ConnectionManager(), thereby removing all prior connection information. --- src/container-registrations.const.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/container-registrations.const.ts b/src/container-registrations.const.ts index ed7e841..8e82e2f 100644 --- a/src/container-registrations.const.ts +++ b/src/container-registrations.const.ts @@ -7,4 +7,4 @@ import { ConnectionManager } from 'typeorm'; * We need to set imported TypeORM classes before requesting them, otherwise we * would receive a "ServiceNotFoundError" above TypeDI 0.9.1 from the decorators. */ -Container.set({ id: ConnectionManager, type: ConnectionManager }); +Container.set({ id: ConnectionManager, type: ConnectionManager, global: true });