diff --git a/CHANGELOG.md b/CHANGELOG.md index dd957780b..682714fcc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] +### Fixed +- Only allow a single instance of ErsatzTV to run + - This fixes some cases where the search index would become unusable ## [0.8.0-beta] - 2023-06-23 ### Added diff --git a/ErsatzTV/Program.cs b/ErsatzTV/Program.cs index 67ca8e2aa..0591da7c0 100644 --- a/ErsatzTV/Program.cs +++ b/ErsatzTV/Program.cs @@ -43,6 +43,13 @@ public class Program public static async Task Main(string[] args) { + using var _ = new Mutex(true, "Global\\ErsatzTV.Singleton.74360cd8985c4d1fb6bc9e81887206fe", out bool createdNew); + if (!createdNew) + { + Console.WriteLine("Another instance of ErsatztTV is already running."); + return 1; + } + LoggingLevelSwitch.MinimumLevel = LogEventLevel.Information; LoggerConfiguration loggerConfiguration = new LoggerConfiguration()