From 5a3c32ff117384e0ef3dd5f2d56a75645b21fad4 Mon Sep 17 00:00:00 2001 From: dingo Date: Fri, 30 Jan 2026 12:47:59 -0500 Subject: [PATCH] Nope Redis still borked. --- Program.cs | 8 ++++++++ Redis/IRedisManager.cs | 36 ++++++++++++++++++------------------ 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/Program.cs b/Program.cs index 3edcca5..ff9abdd 100644 --- a/Program.cs +++ b/Program.cs @@ -8,6 +8,7 @@ using GameServices.Admin.Pages; using GameServices.Auth; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.DataProtection; +using Microsoft.AspNetCore.DataProtection.KeyManagement; using Microsoft.AspNetCore.Http; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; @@ -111,6 +112,13 @@ builder.Services.AddDataProtection() //} var app = builder.Build(); +var keyManager = app.Services.GetRequiredService(); +var keys = keyManager.GetAllKeys(); +app.Logger.LogInformation("DP keys present: {Count}", keys.Count); +foreach (var k in keys) + app.Logger.LogInformation("DP key: {Id} Created={Created} Expires={Expires} Revoked={Revoked}", + k.KeyId, k.CreationDate, k.ExpirationDate, k.IsRevoked); + var dungeonHandler = app.Services.GetRequiredService(); await dungeonHandler.InitializeAsync(); diff --git a/Redis/IRedisManager.cs b/Redis/IRedisManager.cs index 99724d8..4242c23 100644 --- a/Redis/IRedisManager.cs +++ b/Redis/IRedisManager.cs @@ -180,28 +180,28 @@ public sealed class RedisManager : IRedisManager if (!string.IsNullOrWhiteSpace(password)) cs += $",password={password}"; return cs; } - public async Task FlushDatabaseAsync() - { - // Redis flush commands are server-level, not IDatabase-level - var endpoints = _mux.GetEndPoints(); + //public async Task FlushDatabaseAsync() + //{ + // // Redis flush commands are server-level, not IDatabase-level + // var endpoints = _mux.GetEndPoints(); - foreach (var endpoint in endpoints) - { - var server = _mux.GetServer(endpoint); + // foreach (var endpoint in endpoints) + // { + // var server = _mux.GetServer(endpoint); - if (!server.IsConnected) - continue; + // if (!server.IsConnected) + // continue; - if (server.IsReplica) - { - _logger.LogDebug("Skipping replica endpoint {Endpoint}", endpoint); - continue; - } + // if (server.IsReplica) + // { + // _logger.LogDebug("Skipping replica endpoint {Endpoint}", endpoint); + // continue; + // } - _logger.LogWarning("FLUSHDB issued on Redis endpoint {Endpoint}", endpoint); - await server.FlushDatabaseAsync(Db.Database); - } - } + // _logger.LogWarning("FLUSHDB issued on Redis endpoint {Endpoint}", endpoint); + // await server.FlushDatabaseAsync(Db.Database); + // } + //} }