@@ -538,44 +538,25 @@ private void StartDaemonProcess()
538
538
Directory . CreateDirectory ( _mutagenDataDirectory ) ;
539
539
var logPath = Path . Combine ( _mutagenDataDirectory , "daemon.log" ) ;
540
540
var logStream = new StreamWriter ( logPath , true ) ;
541
- try
542
- {
543
- _daemonProcess = new Process ( ) ;
544
- _daemonProcess . StartInfo . FileName = _mutagenExecutablePath ;
545
- _daemonProcess . StartInfo . Arguments = "daemon run" ;
546
- _daemonProcess . StartInfo . Environment . Add ( "MUTAGEN_DATA_DIRECTORY" , _mutagenDataDirectory ) ;
547
- // hide the console window
548
- _daemonProcess . StartInfo . CreateNoWindow = true ;
549
- // shell needs to be disabled since we set the environment
550
- // https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.processstartinfo.environment?view=net-8.0
551
- _daemonProcess . StartInfo . UseShellExecute = false ;
552
- _daemonProcess . StartInfo . RedirectStandardError = true ;
553
- // TODO: log exited process
554
- // _daemonProcess.Exited += ...
555
- if ( ! _daemonProcess . Start ( ) )
556
- throw new InvalidOperationException ( "Failed to start mutagen daemon process, Start returned false" ) ;
557
-
558
- var writer = new LogWriter ( _daemonProcess . StandardError , logStream ) ;
559
- Task . Run ( ( ) => { _ = writer . Run ( ) ; } ) ;
560
- _logWriter = writer ;
561
- }
562
- catch
563
- {
564
- try
565
- {
566
- _daemonProcess ? . Kill ( ) ;
567
- }
568
- catch
569
- {
570
- // ignored
571
- }
572
541
573
- _daemonProcess ? . Dispose ( ) ;
574
- _logWriter ? . Dispose ( ) ;
575
- _daemonProcess = null ;
576
- _logWriter = null ;
577
- throw ;
578
- }
542
+ _daemonProcess = new Process ( ) ;
543
+ _daemonProcess . StartInfo . FileName = _mutagenExecutablePath ;
544
+ _daemonProcess . StartInfo . Arguments = "daemon run" ;
545
+ _daemonProcess . StartInfo . Environment . Add ( "MUTAGEN_DATA_DIRECTORY" , _mutagenDataDirectory ) ;
546
+ // hide the console window
547
+ _daemonProcess . StartInfo . CreateNoWindow = true ;
548
+ // shell needs to be disabled since we set the environment
549
+ // https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.processstartinfo.environment?view=net-8.0
550
+ _daemonProcess . StartInfo . UseShellExecute = false ;
551
+ _daemonProcess . StartInfo . RedirectStandardError = true ;
552
+ // TODO: log exited process
553
+ // _daemonProcess.Exited += ...
554
+ if ( ! _daemonProcess . Start ( ) )
555
+ throw new InvalidOperationException ( "Failed to start mutagen daemon process, Start returned false" ) ;
556
+
557
+ var writer = new LogWriter ( _daemonProcess . StandardError , logStream ) ;
558
+ Task . Run ( ( ) => { _ = writer . Run ( ) ; } ) ;
559
+ _logWriter = writer ;
579
560
}
580
561
581
562
/// <summary>
0 commit comments