Directly add new device to cache
Signed-off-by: gnattu <gnattuoc@me.com>
This commit is contained in:
parent
4f2b1736ab
commit
7f12677dc3
|
@ -97,12 +97,8 @@ namespace Jellyfin.Server.Implementations.Devices
|
||||||
await using (dbContext.ConfigureAwait(false))
|
await using (dbContext.ConfigureAwait(false))
|
||||||
{
|
{
|
||||||
dbContext.Devices.Add(device);
|
dbContext.Devices.Add(device);
|
||||||
|
|
||||||
await dbContext.SaveChangesAsync().ConfigureAwait(false);
|
await dbContext.SaveChangesAsync().ConfigureAwait(false);
|
||||||
var newDevice = await dbContext.Devices
|
_devices.TryAdd(device.Id, device);
|
||||||
.FirstAsync(d => d.Id == device.Id)
|
|
||||||
.ConfigureAwait(false);
|
|
||||||
_devices.TryAdd(device.Id, newDevice);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return device;
|
return device;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user