Skip to content

Commit 5b6503a

Browse files
authored
perf: connectionError to connectionErrorFactory
1 parent 923ca93 commit 5b6503a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/interfaces/mongoose-options.interface.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export interface MongooseModuleOptions
99
retryDelay?: number;
1010
connectionName?: string;
1111
connectionFactory?: (connection: any, name: string) => any;
12-
connectionError?: (error: MongooseError) => MongooseError;
12+
connectionErrorFactory?: (error: MongooseError) => MongooseError;
1313
}
1414

1515
export interface MongooseOptionsFactory {

lib/mongoose-core.module.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ export class MongooseCoreModule implements OnApplicationShutdown {
4040
retryDelay,
4141
connectionName,
4242
connectionFactory,
43-
connectionError,
43+
connectionErrorFactory,
4444
...mongooseOptions
4545
} = options;
4646

4747
const mongooseConnectionFactory =
4848
connectionFactory || ((connection) => connection);
4949

5050
const mongooseConnectionError =
51-
connectionError || ((error) => error);
51+
connectionErrorFactory || ((error) => error);
5252

5353
const mongooseConnectionName = getConnectionToken(connectionName);
5454

@@ -98,15 +98,15 @@ export class MongooseCoreModule implements OnApplicationShutdown {
9898
retryDelay,
9999
uri,
100100
connectionFactory,
101-
connectionError,
101+
connectionErrorFactory,
102102
...mongooseOptions
103103
} = mongooseModuleOptions;
104104

105105
const mongooseConnectionFactory =
106106
connectionFactory || ((connection) => connection);
107107

108108
const mongooseConnectionError =
109-
connectionError || ((error) => error);
109+
connectionErrorFactory || ((error) => error);
110110

111111
return await lastValueFrom(
112112
defer(async () =>

0 commit comments

Comments
 (0)