浏览代码

Actually create readonly connection when asked

Bond_009 1 年之前
父节点
当前提交
0f67a5ba2f
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Emby.Server.Implementations/Data/BaseSqliteRepository.cs

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

@@ -100,7 +100,7 @@ namespace Emby.Server.Implementations.Data
 
         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)