From cf6b9cf29a4c1c8358afb61df7ec974937e925f5 Mon Sep 17 00:00:00 2001 From: Jason Dove <1695733+jasongdove@users.noreply.github.com> Date: Fri, 18 Jul 2025 11:17:21 +0000 Subject: [PATCH] enable write-ahead logging on all sqlite databases (#2162) --- CHANGELOG.md | 1 + ErsatzTV.Infrastructure/Data/DbInitializer.cs | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb90c2a26..729c80d67 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -109,6 +109,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Expand special zero-count case for `Multiple` playout mode with playlists - This configuration will automatically maintain the multiple count so that it is equal to the number of items in each playlist item - This configuration should be used if you want to play every media item in a playlist item exactly once before advancing +- Enable write-ahead logging (WAL) mode on SQLite databases ### Fixed - Fix QSV acceleration in docker with older Intel devices diff --git a/ErsatzTV.Infrastructure/Data/DbInitializer.cs b/ErsatzTV.Infrastructure/Data/DbInitializer.cs index 46eb6e0c4..ed5b10d1d 100644 --- a/ErsatzTV.Infrastructure/Data/DbInitializer.cs +++ b/ErsatzTV.Infrastructure/Data/DbInitializer.cs @@ -1,5 +1,6 @@ using System.Globalization; using System.Reflection; +using Dapper; using ErsatzTV.Core.Domain; namespace ErsatzTV.Infrastructure.Data; @@ -8,6 +9,8 @@ public static class DbInitializer { public static async Task Initialize(TvContext context, CancellationToken cancellationToken) { + await context.Connection.ExecuteAsync("PRAGMA journal_mode=WAL", cancellationToken); + if (!context.LanguageCodes.Any()) { var assembly = Assembly.GetEntryAssembly();