add global mutex to ensure single instance (#1324)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -43,6 +43,13 @@ public class Program
|
||||
|
||||
public static async Task<int> 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()
|
||||
|
||||
Reference in New Issue
Block a user