File tree Expand file tree Collapse file tree 1 file changed +0
-40
lines changed
Expand file tree Collapse file tree 1 file changed +0
-40
lines changed Original file line number Diff line number Diff line change @@ -132,32 +132,6 @@ public void Wait()
132132 logFile . Close ( ) ;
133133 }
134134
135- public void Restart ( )
136- {
137- if ( restartTimer != null )
138- {
139- restartTimer . Stop ( ) ;
140- }
141- /* try-catch... because there could be a concurrency issue (write-after-read) here? */
142- if ( ! process . HasExited )
143- {
144- process . Exited -= Watchdog ;
145- process . Exited += FastRestart ; // Restart the process after kill
146- try
147- {
148- process . Kill ( ) ;
149- }
150- catch ( InvalidOperationException )
151- {
152- Start ( ) ;
153- }
154- }
155- else
156- {
157- Start ( ) ;
158- }
159- }
160-
161135 private void WriteToLog ( object sendingProcess , DataReceivedEventArgs e )
162136 {
163137 if ( e != null )
@@ -179,20 +153,6 @@ private void Watchdog(object sender, EventArgs e)
179153 restartTimer . Start ( ) ;
180154 }
181155
182- /// Restart after 3 seconds
183- /// For use with Restart() (e.g. after a resume)
184- private void FastRestart ( object sender , EventArgs e )
185- {
186- config . LogMessage ( "Process for " + configFile + " restarting in 3 sec" ) ;
187- restartTimer = new System . Timers . Timer ( 3000 ) ;
188- restartTimer . AutoReset = false ;
189- restartTimer . Elapsed += ( object source , System . Timers . ElapsedEventArgs ev ) =>
190- {
191- Start ( ) ;
192- } ;
193- restartTimer . Start ( ) ;
194- }
195-
196156 public void Start ( )
197157 {
198158 process = new System . Diagnostics . Process ( ) ;
You can’t perform that action at this time.
0 commit comments