Apply suggestions from code review

pull/7240/head
Cody Robibero 3 years ago committed by GitHub
parent 09b8cde6aa
commit b705ace262
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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…
Cancel
Save