def nofail(*args, **kwargs): """Complete the task if it is re-run without failing.""" task_id = kwargs.pop('task_id') progress = kwargs.pop('progress') if progress is None: task.update(task_id, 'one') return 'one' task.finish(task_id) return (args, kwargs)
def manual_retry(*args, **kwargs): """Complete the task if it is re-run.""" task_id = kwargs.pop('task_id') progress = kwargs.pop('progress') if progress is None: task.fail(task_id, 'fail') return 'fail' task.finish(task_id) return (args, kwargs)