File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
src/WebJobs.Script/Workers/ProcessManagement Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -179,12 +179,18 @@ private void OnProcessExited(object sender, EventArgs e)
179
179
return ;
180
180
}
181
181
182
+ int exit = 0 ;
182
183
try
183
184
{
184
185
ThrowIfExitError ( ) ;
185
186
186
- Process . WaitForExit ( ) ;
187
- if ( Process . ExitCode == WorkerConstants . IntentionalRestartExitCode )
187
+ exit = Process . ExitCode ;
188
+ if ( Process . ExitCode == WorkerConstants . SuccessExitCode )
189
+ {
190
+ Process . WaitForExit ( ) ;
191
+ Process . Close ( ) ;
192
+ }
193
+ else if ( Process . ExitCode == WorkerConstants . IntentionalRestartExitCode )
188
194
{
189
195
HandleWorkerProcessRestart ( ) ;
190
196
}
@@ -202,9 +208,8 @@ private void OnProcessExited(object sender, EventArgs e)
202
208
}
203
209
finally
204
210
{
205
- _processExit . TrySetResult ( Process . ExitCode ) ;
211
+ _processExit . TrySetResult ( exit ) ;
206
212
UnregisterFromProcessMonitor ( ) ;
207
- Process . Close ( ) ;
208
213
}
209
214
}
210
215
You can’t perform that action at this time.
0 commit comments