mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-11-15 09:59:06 -07:00
Apply suggestions from code review
This commit is contained in:
parent
09b8cde6aa
commit
b705ace262
@ -97,6 +97,7 @@ namespace Emby.Server.Implementations.Data
|
||||
/// </summary>
|
||||
/// <value>The write connection.</value>
|
||||
protected SQLiteDatabaseConnection WriteConnection { get; set; }
|
||||
|
||||
protected SQLiteDatabaseConnection ReadConnection { get; set; }
|
||||
|
||||
protected ManagedConnection GetConnection(bool readOnly = false)
|
||||
@ -104,7 +105,7 @@ namespace Emby.Server.Implementations.Data
|
||||
if (readOnly)
|
||||
{
|
||||
ReadConnection ??= SQLite3.Open(DbFilePath, ConnectionFlags.ReadOnly, null);
|
||||
return new ManagedConnection(ReadConnection, null!);
|
||||
return new ManagedConnection(ReadConnection, null);
|
||||
}
|
||||
|
||||
WriteLock.Wait();
|
||||
|
@ -15,8 +15,7 @@ namespace Emby.Server.Implementations.Data
|
||||
|
||||
private bool _disposed;
|
||||
|
||||
|
||||
public ManagedConnection(SQLiteDatabaseConnection db, SemaphoreSlim writeLock)
|
||||
public ManagedConnection(SQLiteDatabaseConnection db, SemaphoreSlim? writeLock)
|
||||
{
|
||||
_db = db;
|
||||
_writeLock = writeLock;
|
||||
|
Loading…
Reference in New Issue
Block a user