|
12 | 12 | using GeneXus.Services.OpenTelemetry; |
13 | 13 | using GeneXus.Utils; |
14 | 14 | using GxClasses.Web.Middleware; |
| 15 | + |
15 | 16 | using Microsoft.AspNetCore; |
16 | 17 | using Microsoft.AspNetCore.Antiforgery; |
17 | 18 | using Microsoft.AspNetCore.Builder; |
|
36 | 37 | using Microsoft.Extensions.Diagnostics.HealthChecks; |
37 | 38 | using Microsoft.Extensions.FileProviders; |
38 | 39 | using Microsoft.Extensions.Logging; |
| 40 | + |
39 | 41 | using StackExchange.Redis; |
40 | 42 |
|
41 | 43 | namespace GeneXus.Application |
@@ -64,6 +66,7 @@ public static void Main(string[] args) |
64 | 66 | LocatePhysicalLocalPath(); |
65 | 67 |
|
66 | 68 | } |
| 69 | + |
67 | 70 | if (port == DEFAULT_PORT) |
68 | 71 | { |
69 | 72 | BuildWebHost(null).Run(); |
@@ -310,11 +313,13 @@ private void DefineCorsPolicy(IServiceCollection services) |
310 | 313 |
|
311 | 314 | private void ConfigureSessionService(IServiceCollection services, ISessionService sessionService) |
312 | 315 | { |
| 316 | + |
313 | 317 | if (sessionService is GxRedisSession) |
314 | 318 | { |
315 | 319 | GXLogging.Info(log, $"Using Redis for Distributed session, ConnectionString:{sessionService.ConnectionString}, InstanceName: {sessionService.InstanceName}"); |
| 320 | + |
316 | 321 | services.AddSingleton<IDistributedCache>(sp => |
317 | | - new CustomRedisSessionStore(sessionService.ConnectionString, TimeSpan.FromMinutes(Preferences.SessionTimeout), sessionService.InstanceName)); |
| 322 | + new CustomRedisSessionStore(sessionService.ConnectionString, TimeSpan.FromMinutes(Preferences.SessionTimeout), sessionService.InstanceName)); |
318 | 323 | services.AddDataProtection().PersistKeysToStackExchangeRedis(ConnectionMultiplexer.Connect(sessionService.ConnectionString), DATA_PROTECTION_KEYS).SetApplicationName(sessionService.InstanceName); |
319 | 324 | } |
320 | 325 | else if (sessionService is GxDatabaseSession) |
|
0 commit comments