Fix MemoryCache Usage.

pull/3840/head
Patrick Barron 4 years ago
parent c82b26a4b1
commit bea519de5b

@ -426,7 +426,7 @@ namespace Emby.Server.Implementations.Channels
var mediaInfo = await channel.GetChannelItemMediaInfo(id, cancellationToken) var mediaInfo = await channel.GetChannelItemMediaInfo(id, cancellationToken)
.ConfigureAwait(false); .ConfigureAwait(false);
var list = mediaInfo.ToList(); var list = mediaInfo.ToList();
_memoryCache.CreateEntry(id).SetValue(list).SetAbsoluteExpiration(DateTimeOffset.UtcNow.AddMinutes(5)); _memoryCache.Set(id, list, DateTimeOffset.UtcNow.AddMinutes(5));
return list; return list;
} }

@ -53,7 +53,7 @@ namespace Emby.Server.Implementations.Devices
lock (_capabilitiesSyncLock) lock (_capabilitiesSyncLock)
{ {
_memoryCache.CreateEntry(deviceId).SetValue(capabilities); _memoryCache.Set(deviceId, capabilities);
_json.SerializeToFile(capabilities, path); _json.SerializeToFile(capabilities, path);
} }
} }

Loading…
Cancel
Save