I have a situation where I would like to use thundering herd avoidance conditionally.
It would be easy to support this with a conditional check at https://github.com/PolicyStat/jobtastic/blob/master/jobtastic/task.py#L242 and pop the key out of the options that get passed to the superclass.
Something like the following should do the trick:
# Check for an in-progress equivalent task to avoid duplicating work
if not options.pop('disable_thundering_herd_avoidance', False):
task_id = cache.get('herd:%s' % cache_key)
if task_id:
logging.info('Found existing in-progress task: %s', task_id)
return self.AsyncResult(task_id)
This would work nicely with #56
I have a situation where I would like to use thundering herd avoidance conditionally.
It would be easy to support this with a conditional check at https://github.com/PolicyStat/jobtastic/blob/master/jobtastic/task.py#L242 and pop the key out of the options that get passed to the superclass.
Something like the following should do the trick:
This would work nicely with #56