Files
Mapo-IOB/SMGen/Pages/ForceReset.razor.cs
Samuele Locatelli 55f40679b5 - Fix gestione calc olo versione
- Fix reload con baseUrl
2024-08-19 18:32:16 +02:00

32 lines
880 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;
}
}