Skip to content

Commit 5965167

Browse files
Merge pull request #1083 from jmcdo29/fix/mongoose-connection
fix: create the connection as a promise with asPromise
2 parents 836f524 + 63b6b07 commit 5965167

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)