File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -177,10 +177,10 @@ def engine_process(self):
177
177
178
178
def engine_kill (self ):
179
179
if self .process :
180
- self . process . kill ()
181
- return self .process .wait ()
182
- else :
183
- return None
180
+ try :
181
+ self .process .kill ()
182
+ except :
183
+ pass
184
184
185
185
def engine_get_id (self ):
186
186
if self .process :
@@ -391,12 +391,11 @@ def task_flush(taskid):
391
391
"""
392
392
Flush task spool (delete all tasks)
393
393
"""
394
- if is_admin (taskid ):
395
- DataStore .tasks = dict ()
396
- else :
397
- for key in list (DataStore .tasks ):
398
- if DataStore .tasks [key ].remote_addr == request .remote_addr :
399
- del DataStore .tasks [key ]
394
+
395
+ for key in list (DataStore .tasks ):
396
+ if is_admin (taskid ) or DataStore .tasks [key ].remote_addr == request .remote_addr :
397
+ DataStore .tasks [key ].engine_kill ()
398
+ del DataStore .tasks [key ]
400
399
401
400
logger .debug ("[%s] Flushed task pool (%s)" % (taskid , "admin" if is_admin (taskid ) else request .remote_addr ))
402
401
return jsonize ({"success" : True })
You can’t perform that action at this time.
0 commit comments