mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-24 01:34:45 +03:00
Backport pull request #11969 from jellyfin/release-10.9.z
Create readonly DB connections when possible
Original-merge: a46c17e19f
Merged-by: joshuaboniface <joshua@boniface.me>
Backported-by: Joshua M. Boniface <joshua@boniface.me>
This commit is contained in:
committed by
Joshua M. Boniface
parent
cd5fb84136
commit
78e8eae5ad
@@ -98,9 +98,9 @@ namespace Emby.Server.Implementations.Data
|
||||
}
|
||||
}
|
||||
|
||||
protected SqliteConnection GetConnection()
|
||||
protected SqliteConnection GetConnection(bool readOnly = false)
|
||||
{
|
||||
var connection = new SqliteConnection($"Filename={DbFilePath}");
|
||||
var connection = new SqliteConnection($"Filename={DbFilePath}" + (readOnly ? ";Mode=ReadOnly" : string.Empty));
|
||||
connection.Open();
|
||||
|
||||
if (CacheSize.HasValue)
|
||||
|
||||
Reference in New Issue
Block a user