2025-01-23 00:25:11 -06:00
|
|
|
using ZiggyCreatures.Caching.Fusion;
|
|
|
|
|
|
|
|
|
|
namespace LANCommander.Server.Services.Extensions;
|
|
|
|
|
|
|
|
|
|
public static class CacheExtensions
|
|
|
|
|
{
|
2025-02-23 08:49:43 -06:00
|
|
|
public static async Task ExpireGameCacheAsync(this IFusionCache cache)
|
|
|
|
|
{
|
|
|
|
|
await cache.RemoveByTagAsync(["Games", "Depot"]);
|
|
|
|
|
}
|
2025-01-23 00:25:11 -06:00
|
|
|
public static async Task ExpireGameCacheAsync(this IFusionCache cache, Guid? gameId)
|
|
|
|
|
{
|
|
|
|
|
if (gameId.HasValue)
|
2025-02-09 01:37:31 -06:00
|
|
|
await cache.RemoveByTagAsync([ $"Games/{gameId}", "Games", "Depot"]);
|
2025-02-22 00:26:54 -06:00
|
|
|
else
|
|
|
|
|
await cache.RemoveByTagAsync(["Games", "Depot"]);
|
2025-01-23 00:25:11 -06:00
|
|
|
}
|
|
|
|
|
}
|