mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-08-27 04:16:47 +00:00
chore: Add a read only connection for routes like Shows/NextUp
This commit is contained in:
parent
cd4587b43f
commit
2e4dd02f76
2 changed files with 11 additions and 3 deletions
|
|
@ -97,9 +97,16 @@ 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)
|
||||
{
|
||||
if (readOnly)
|
||||
{
|
||||
ReadConnection ??= SQLite3.Open(DbFilePath, DefaultConnectionFlags | ConnectionFlags.ReadOnly, null);
|
||||
return new ManagedConnection(ReadConnection, null);
|
||||
}
|
||||
|
||||
WriteLock.Wait();
|
||||
if (WriteConnection != null)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue