Refresh fix, Dungeon Builder v2
This commit is contained in:
@@ -41,7 +41,14 @@ public class LootService
|
||||
public async Task InitializeAsync()
|
||||
{
|
||||
if (_initialized) return;
|
||||
|
||||
await RefreshCacheAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Refresh all loot-related caches (can be called on-demand from admin)
|
||||
/// </summary>
|
||||
public async Task RefreshCacheAsync()
|
||||
{
|
||||
using var scope = _scopeFactory.CreateScope();
|
||||
var db = scope.ServiceProvider.GetRequiredService<GameDbContext>();
|
||||
|
||||
@@ -95,7 +102,7 @@ public class LootService
|
||||
_itemDefinitions = items.ToDictionary(i => i.Id);
|
||||
|
||||
_initialized = true;
|
||||
_log.LogInformation("LootService initialized: {Tables} tables, {Items} items, {Mappings} mob mappings",
|
||||
_log.LogInformation("LootService cache refreshed: {Tables} tables, {Items} items, {Mappings} mob mappings",
|
||||
_lootTables.Count, _itemDefinitions.Count, mappings.Count);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user