Merge pull request #3840 from barronpm/fix-memorycache

Fix MemoryCache Usage.
This commit is contained in:
Bond-009 2020-08-07 19:27:34 +02:00 committed by GitHub
commit 7e49358ba9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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;
}

View File

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