@@ -122,10 +122,8 @@ def start_process(self, **kwargs):
122
122
123
123
self .monitor_thread = threading .Thread (target = self .monitor_process )
124
124
self .monitor_thread .start ()
125
- self .stdout_thread = threading .Thread (target = log_output , args = (self .process .stdout ,))
126
- self .stdout_thread .start ()
127
- self .stderr_thread = threading .Thread (target = log_output , args = (self .process .stderr ,))
128
- self .stderr_thread .start ()
125
+ self .log_thread = threading .Thread (target = log_output , args = (self .process .stdout ,))
126
+ self .log_thread .start ()
129
127
130
128
except subprocess .CalledProcessError as e :
131
129
raise InferenceError (f"Error starting infer.py: { e } " )
@@ -174,12 +172,9 @@ def stop_process(self, is_monitor_thread: bool = False):
174
172
if self .monitor_thread and not is_monitor_thread :
175
173
self .monitor_thread .join ()
176
174
self .monitor_thread = None
177
- if self .stdout_thread :
178
- self .stdout_thread .join ()
179
- self .stdout_thread = None
180
- if self .stderr_thread :
181
- self .stderr_thread .join ()
182
- self .stderr_thread = None
175
+ if self .log_thread :
176
+ self .log_thread .join ()
177
+ self .log_thread = None
183
178
logging .info ("Infer process stopped successfully" )
184
179
185
180
def __str__ (self ) -> str :
0 commit comments