Funx flush cache x vocabolario

This commit is contained in:
Samuele Locatelli
2026-06-04 10:09:31 +02:00
parent 652d1dee4a
commit 8183de796c
8 changed files with 34 additions and 22 deletions
@@ -24,6 +24,12 @@
/// <returns></returns>
Task<List<VocabolarioModel>> GetAllAsync();
/// <summary>
/// Cancellazione FusionCache (totale)
/// </summary>
/// <returns></returns>
Task<bool> FlushFusionCacheAsync();
/// <summary>
/// Recupera un Vocabolario per ID
/// </summary>
@@ -45,7 +51,7 @@
Task<List<LinguaModel>> ListLingueAsync();
/// <summary>
/// Traduzione lemma nella lingua desiderata
/// Esegue traduzione dato vocabolario da Lingua + Lemma
/// </summary>
/// <param name="lemma"></param>
/// <param name="lingua"></param>
@@ -87,6 +87,13 @@ namespace EgwCoreLib.Lux.Data.Services.Admin
});
}
/// <inheritdoc />
public async Task<bool> FlushFusionCacheAsync()
{
await _cache.ClearAsync(allowFailSafe: false);
return true;
}
/// <inheritdoc />
public async Task<List<VocabolarioModel>> GetAllAsync()
{
@@ -151,12 +158,6 @@ namespace EgwCoreLib.Lux.Data.Services.Admin
}
/// <inheritdoc />
/// <summary>
/// Esegue traduzione dato vocabolario da Lingua + Lemma
/// </summary>
/// <param name="lemma"></param>
/// <param name="lingua"></param>
/// <returns></returns>
public string Traduci(string lemma, string lingua = "IT")
{
if (string.IsNullOrWhiteSpace(lemma)) return string.Empty;
@@ -211,11 +212,6 @@ namespace EgwCoreLib.Lux.Data.Services.Admin
return answ;
}
/// <summary>
/// Oggetto gestione FusionCache
/// </summary>
protected readonly IFusionCache _cache;
/// <inheritdoc />
public async Task<bool> UpsertAsync(VocabolarioModel upsRec)
{
@@ -291,15 +287,20 @@ namespace EgwCoreLib.Lux.Data.Services.Admin
#endregion Public Methods
#region Protected Fields
/// <summary>
/// Oggetto gestione FusionCache
/// </summary>
protected readonly IFusionCache _cache;
#endregion Protected Fields
#region Private Fields
private readonly string _className;
private readonly IDbContextFactory<DataLayerContext> _factory;
#endregion Private Fields
#region Private Methods
#endregion Private Methods
}
}
}
+1 -1
View File
@@ -4,7 +4,7 @@
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Version>1.1.2606.0409</Version>
<Version>1.1.2606.0410</Version>
</PropertyGroup>
<ItemGroup>
+5
View File
@@ -14,12 +14,17 @@
[Inject]
protected IConfiguration Config { get; set; } = null!;
[Inject]
protected IVocabolarioService VService { get; set; } = null!;
protected override async Task OnInitializedAsync()
{
string baseUrl = Config.GetValue<string>("ServerConf:BaseUrl") ?? "";
await Task.Delay(100);
await DLService.FlushCacheAsync();
await Task.Delay(100);
await VService.FlushFusionCacheAsync();
await Task.Delay(100);
NavMan.NavigateTo(baseUrl, true);
}
}
+1 -1
View File
@@ -5,7 +5,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>aspnet-Lux.UI-a758c101-a2f4-4e38-977d-1c4887dbbd50</UserSecretsId>
<Version>1.1.2606.0409</Version>
<Version>1.1.2606.0410</Version>
</PropertyGroup>
<ItemGroup>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>LUX - Web Windows MES</i>
<h4>Versione: 1.1.2606.0409</h4>
<h4>Versione: 1.1.2606.0410</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
1.1.2606.0409
1.1.2606.0410
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>1.1.2606.0409</version>
<version>1.1.2606.0410</version>
<url>http://nexus.steamware.net/repository/SWS/GPW/stable/GPW.UI.zip</url>
<changelog>http://nexus.steamware.net/repository/SWS/GPW/stable/ChangeLog.html</changelog>
<mandatory>false</mandatory>