Skip to content

Commit 63b6b07

Browse files
committed
fix: create the connection as a promise with asPromise
1 parent 836f524 commit 63b6b07

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/mongoose-core.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export class MongooseCoreModule implements OnApplicationShutdown {
5656
await lastValueFrom(
5757
defer(async () =>
5858
mongooseConnectionFactory(
59-
mongoose.createConnection(uri, mongooseOptions),
59+
await mongoose.createConnection(uri, mongooseOptions).asPromise(),
6060
mongooseConnectionName,
6161
),
6262
).pipe(handleRetry(retryAttempts, retryDelay)),

0 commit comments

Comments
 (0)