Quellcode durchsuchen

Apply suggestions from code review

Cody Robibero vor 3 Jahren
Ursprung
Commit
b705ace262

+ 2 - 1
Emby.Server.Implementations/Data/BaseSqliteRepository.cs

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

+ 1 - 2
Emby.Server.Implementations/Data/ManagedConnection.cs

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