Skip to main content

time_limit

Tell worker(s) to modify the time limit for task by type.

def time_limit(
state: object,
task_name: string,
hard: float,
soft: float,
**kwargs: any
) - > dict

Tell worker(s) to modify the time limit for task by type.

Parameters

NameTypeDescription
stateobjectThe current worker state object containing the application instance and task registry.
task_namestringName of the task type for which time limits should be modified.
hardfloatThe maximum number of seconds a task can run before it is forcefully terminated.
softfloatThe number of seconds a task can run before a soft timeout exception is raised, allowing for graceful cleanup.
**kwargsanyAdditional keyword arguments passed by the control command decorator.

Returns

TypeDescription
dictA dictionary containing a status message indicating whether the time limits were set successfully or if the task was unknown.