From bea519de5b78f03f44fe04a4231a63838a010594 Mon Sep 17 00:00:00 2001 From: Patrick Barron Date: Fri, 7 Aug 2020 13:22:18 -0400 Subject: [PATCH] Fix MemoryCache Usage. --- Emby.Server.Implementations/Channels/ChannelManager.cs | 2 +- Emby.Server.Implementations/Devices/DeviceManager.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Emby.Server.Implementations/Channels/ChannelManager.cs b/Emby.Server.Implementations/Channels/ChannelManager.cs index 8d6292867b..d8ab1f1a14 100644 --- a/Emby.Server.Implementations/Channels/ChannelManager.cs +++ b/Emby.Server.Implementations/Channels/ChannelManager.cs @@ -426,7 +426,7 @@ namespace Emby.Server.Implementations.Channels var mediaInfo = await channel.GetChannelItemMediaInfo(id, cancellationToken) .ConfigureAwait(false); var list = mediaInfo.ToList(); - _memoryCache.CreateEntry(id).SetValue(list).SetAbsoluteExpiration(DateTimeOffset.UtcNow.AddMinutes(5)); + _memoryCache.Set(id, list, DateTimeOffset.UtcNow.AddMinutes(5)); return list; } diff --git a/Emby.Server.Implementations/Devices/DeviceManager.cs b/Emby.Server.Implementations/Devices/DeviceManager.cs index 2921a7f0e0..cc4b407f5c 100644 --- a/Emby.Server.Implementations/Devices/DeviceManager.cs +++ b/Emby.Server.Implementations/Devices/DeviceManager.cs @@ -53,7 +53,7 @@ namespace Emby.Server.Implementations.Devices lock (_capabilitiesSyncLock) { - _memoryCache.CreateEntry(deviceId).SetValue(capabilities); + _memoryCache.Set(deviceId, capabilities); _json.SerializeToFile(capabilities, path); } }