The Free Software Media System - Server Backend & API
Revert "chore: Add a read only connection for routes like Shows/NextUp"
Cody Robibero0a8bec1af446
diff --git a/Emby.Server.Implementations/Data/BaseSqliteRepository.cs b/Emby.Server.Implementations/Data/BaseSqliteRepository.csindex b86511482e..450688491a 100644--- a/Emby.Server.Implementations/Data/BaseSqliteRepository.cs+++ b/Emby.Server.Implementations/Data/BaseSqliteRepository.cs@@ -98,16 +98,8 @@ namespace Emby.Server.Implementations.Data/// <value>The write connection.</value>protected SQLiteDatabaseConnection WriteConnection { get; set; }- protected SQLiteDatabaseConnection ReadConnection { get; set; }-protected ManagedConnection GetConnection(bool readOnly = false){- if (readOnly)- {- ReadConnection ??= SQLite3.Open(DbFilePath, ConnectionFlags.ReadOnly, null);- return new ManagedConnection(ReadConnection, null);- }-WriteLock.Wait();if (WriteConnection != null){diff --git a/Emby.Server.Implementations/Data/ManagedConnection.cs b/Emby.Server.Implementations/Data/ManagedConnection.csindex fe09bdc2a4..11e33278d4 100644--- a/Emby.Server.Implementations/Data/ManagedConnection.cs+++ b/Emby.Server.Implementations/Data/ManagedConnection.cs@@ -9,13 +9,13 @@ namespace Emby.Server.Implementations.Data{public sealed class ManagedConnection : IDisposable{- private readonly SemaphoreSlim? _writeLock;+ private readonly SemaphoreSlim _writeLock;private SQLiteDatabaseConnection? _db;- private bool _disposed;+ private bool _disposed = false;- public ManagedConnection(SQLiteDatabaseConnection db, SemaphoreSlim? writeLock)+ public ManagedConnection(SQLiteDatabaseConnection db, SemaphoreSlim writeLock){_db = db;_writeLock = writeLock;@@ -73,7 +73,7 @@ namespace Emby.Server.Implementations.Datareturn;}- _writeLock?.Release();+ _writeLock.Release();_db = null; // Don't dispose it_disposed = true;