Files
Mapo-IOB/SMGen/Pages/ForceReset.razor.cs
T
2024-08-19 18:20:50 +02:00

32 lines
881 B
C#

using Microsoft.AspNetCore.Components;
using SMGen.Data.Services;
using StackExchange.Redis;
namespace SMGen.Pages
{
public partial class ForceReset
{
[Inject]
protected SMGDataService SMGDService { get; set; } = null!;
[Inject]
protected NavigationManager NavMan { get; set; } = null!;
//protected override Task OnParametersSetAsync()
//{
// return base.OnParametersSetAsync();
//}
protected override async Task OnInitializedAsync()
{
isResetting = true;
RedisValue currKey = new RedisValue($"{Core.Constants.redisBaseAddr}:*");
await SMGDService.ExecFlushRedisPattern(currKey);
await Task.Delay(500);
isResetting = false;
NavMan.NavigateTo("/", true);
}
private bool isResetting = false;
}
}