The additional logic above is not documented in the docstring of the decorator. I would implement a separate task decorator for this use case.