File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
src/labthings/default_views Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 33
44from ..views import View
55from ..views .marshalling import marshal_with
6+ from ..views .args import use_args
67from ..schema import TaskSchema
78from ..find import current_labthing
9+ from .. import fields
810
911
1012class TaskList (View ):
@@ -46,21 +48,22 @@ def get(self, task_id):
4648
4749 return TaskSchema ().dump (task )
4850
49- def delete (self , task_id ):
51+ @use_args ({"timeout" : fields .Int ()})
52+ def delete (self , args , task_id ):
5053 """Terminate a running task.
5154
5255 If the task is finished, deletes its entry.
5356
5457 :param task_id:
5558
5659 """
57-
60+ timeout = args . get ( "timeout" , None )
5861 task_dict = current_labthing ().actions .to_dict ()
5962
6063 if task_id not in task_dict :
6164 return abort (404 ) # 404 Not Found
6265
6366 task = task_dict .get (task_id )
64- task .stop (timeout = 5 )
67+ task .stop (timeout = timeout )
6568
6669 return TaskSchema ().dump (task )
You can’t perform that action at this time.
0 commit comments