Skip to content

Commit fceddaa

Browse files
author
claudiamurialdo
committed
Merge branch 'release-1.31' of https://github.com/genexuslabs/DotNetClasses into release-1.31
2 parents 992b84d + 1557775 commit fceddaa

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

dotnet/src/dotnetcore/GxNetCoreStartup/SessionHelper.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
namespace GeneXus.Application
88
{
9+
910
public class CustomRedisSessionStore : IDistributedCache
1011
{
1112
private readonly IDatabase _db;

dotnet/src/dotnetcore/GxNetCoreStartup/Startup.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
using GeneXus.Services.OpenTelemetry;
1313
using GeneXus.Utils;
1414
using GxClasses.Web.Middleware;
15+
1516
using Microsoft.AspNetCore;
1617
using Microsoft.AspNetCore.Antiforgery;
1718
using Microsoft.AspNetCore.Builder;
@@ -36,6 +37,7 @@
3637
using Microsoft.Extensions.Diagnostics.HealthChecks;
3738
using Microsoft.Extensions.FileProviders;
3839
using Microsoft.Extensions.Logging;
40+
3941
using StackExchange.Redis;
4042

4143
namespace GeneXus.Application
@@ -64,6 +66,7 @@ public static void Main(string[] args)
6466
LocatePhysicalLocalPath();
6567

6668
}
69+
6770
if (port == DEFAULT_PORT)
6871
{
6972
BuildWebHost(null).Run();
@@ -310,11 +313,13 @@ private void DefineCorsPolicy(IServiceCollection services)
310313

311314
private void ConfigureSessionService(IServiceCollection services, ISessionService sessionService)
312315
{
316+
313317
if (sessionService is GxRedisSession)
314318
{
315319
GXLogging.Info(log, $"Using Redis for Distributed session, ConnectionString:{sessionService.ConnectionString}, InstanceName: {sessionService.InstanceName}");
320+
316321
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));
318323
services.AddDataProtection().PersistKeysToStackExchangeRedis(ConnectionMultiplexer.Connect(sessionService.ConnectionString), DATA_PROTECTION_KEYS).SetApplicationName(sessionService.InstanceName);
319324
}
320325
else if (sessionService is GxDatabaseSession)

0 commit comments

Comments
 (0)