File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change 1- import { Logger } from ' @nestjs/common' ;
2- import { Observable } from ' rxjs' ;
3- import { delay , retryWhen , scan } from ' rxjs/operators' ;
4- import { DEFAULT_DB_CONNECTION } from ' ../mongoose.constants' ;
1+ import { Logger } from " @nestjs/common" ;
2+ import { Observable } from " rxjs" ;
3+ import { delay , retryWhen , scan } from " rxjs/operators" ;
4+ import { DEFAULT_DB_CONNECTION } from " ../mongoose.constants" ;
55
66export function getModelToken ( model : string , connectionName ?: string ) {
77 if ( connectionName === undefined ) {
@@ -29,12 +29,17 @@ export function handleRetry(
2929 scan ( ( errorCount , error ) => {
3030 const verboseMessage = verboseRetryLog
3131 ? ` Message: ${ error . message } .`
32- : '' ;
32+ : "" ;
33+ const retryMessage = retryAttempts > 0
34+ ? ` Retrying (${ errorCount + 1 } )...`
35+ : "" ;
3336
3437 logger . error (
35- `Unable to connect to the database.${ verboseMessage } Retrying (${
36- errorCount + 1
37- } )...`,
38+ [
39+ "Unable to connect to the database." ,
40+ verboseMessage ,
41+ retryMessage ,
42+ ] . join ( "" ) ,
3843 error . stack ,
3944 ) ;
4045 if ( errorCount + 1 >= retryAttempts ) {
You can’t perform that action at this time.
0 commit comments