-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
It would be great to be able to pass in an existing client if the project is already using Mongo instead of maintaining the client connection internally.
// Throttler
@Module({
imports: [
ThrottlerModule.forRootAsync({
imports: [ConfigModule],
inject: [ConfigService, DBService],
useFactory: (config: ConfigService, db: DBService) => [
{
ttl: config.get('THROTTLE_FRAME_TTL_IN_MILLISECONDS', 4000),
limit: config.get('THROTTLE_REQUEST_PER_FRAME_LIMIT', 50),
storage: new ThrottlerStorageMongoService( db.getClient() ) // <-- connection string or allow Client object as input ??
},
],
}),
],
})
export class AppModule {}
Metadata
Metadata
Assignees
Labels
No labels