File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed
Streetwriters.Data/DbContexts Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -33,9 +33,6 @@ public class MongoDbContext(IMongoClient MongoClient) : IDbContext
3333 public static IMongoClient CreateMongoDbClient ( IDbSettings dbSettings )
3434 {
3535 var settings = MongoClientSettings . FromConnectionString ( dbSettings . ConnectionString ) ;
36- settings . MaxConnectionPoolSize = 500 ;
37- settings . MinConnectionPoolSize = 0 ;
38- settings . HeartbeatInterval = TimeSpan . FromSeconds ( 60 ) ;
3936 return new MongoClient ( settings ) ;
4037 }
4138
Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ You should have received a copy of the Affero GNU General Public License
5353using Streetwriters . Identity . Jobs ;
5454using Streetwriters . Identity . Services ;
5555using Streetwriters . Identity . Validation ;
56+ using IdentityServer4 . MongoDB . Configuration ;
5657
5758namespace Streetwriters . Identity
5859{
@@ -107,11 +108,6 @@ public void ConfigureServices(IServiceCollection services)
107108 options . UsersCollection = "users" ;
108109 // options.MigrationCollection = "migration";
109110 options . ConnectionString = connectionString ;
110- options . ClusterConfigurator = builder =>
111- {
112- builder . ConfigureConnectionPool ( ( c ) => c . With ( maxConnections : 500 , minConnections : 0 ) ) ;
113- builder . ConfigureServer ( s => s . With ( heartbeatInterval : TimeSpan . FromSeconds ( 60 ) ) ) ;
114- } ;
115111 } ) . AddDefaultTokenProviders ( ) ;
116112
117113 services . AddIdentityServer (
@@ -137,6 +133,11 @@ public void ConfigureServices(IServiceCollection services)
137133 . AddKeyManagement ( )
138134 . AddFileSystemPersistence ( Path . Combine ( WebHostEnvironment . ContentRootPath , @"keystore" ) ) ;
139135
136+ services . Configure < MongoDBConfiguration > ( options =>
137+ {
138+ options . ConnectionString = connectionString ;
139+ } ) ;
140+
140141 services . Configure < DataProtectionTokenProviderOptions > ( options =>
141142 {
142143 options . TokenLifespan = TimeSpan . FromHours ( 2 ) ;
You can’t perform that action at this time.
0 commit comments