MCPcopy
hub / github.com/celery/celery / time_limit

Method time_limit

celery/app/control.py:645–663  ·  view source on GitHub ↗

Tell workers to set time limits for a task by type. Arguments: task_name (str): Name of task to change time limits for. soft (float): New soft time limit (in seconds). hard (float): New hard time limit (in seconds). **kwargs (Any): arguments p

(self, task_name, soft=None, hard=None,
                   destination=None, **kwargs)

Source from the content-addressed store, hash-verified

643 arguments={'queue': queue}, **kwargs)
644
645 def time_limit(self, task_name, soft=None, hard=None,
646 destination=None, **kwargs):
647 """Tell workers to set time limits for a task by type.
648
649 Arguments:
650 task_name (str): Name of task to change time limits for.
651 soft (float): New soft time limit (in seconds).
652 hard (float): New hard time limit (in seconds).
653 **kwargs (Any): arguments passed on to :meth:`broadcast`.
654 """
655 return self.broadcast(
656 'time_limit',
657 arguments={
658 'task_name': task_name,
659 'hard': hard,
660 'soft': soft,
661 },
662 destination=destination,
663 **kwargs)
664
665 def enable_events(self, destination=None, **kwargs):
666 """Tell all (or specific) workers to enable events.

Callers 2

test_time_limitMethod · 0.80

Calls 1

broadcastMethod · 0.95

Tested by 2

test_time_limitMethod · 0.64