Apply suggestions from code review

This commit is contained in:
Cody Robibero 2022-03-05 12:37:23 -07:00 committed by GitHub
parent 09b8cde6aa
commit b705ace262
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -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();

View File

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