cic-internal-integration/apps/cic-eth/cic_eth/callbacks/noop.py
2021-02-17 10:04:21 +00:00

22 lines
695 B
Python
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import celery
celery_app = celery.current_app
logg = celery_app.log.get_default_logger()
@celery_app.task(bind=True)
def noop(self, result, param, status_code):
"""A noop callback for task chains executed by external api methods. Logs the callback arguments.
:param result: Task context object (on error) or return value of previous task (on success)
:type result: Varies
:param param: Static value passed from api caller
:type param: Varies
:param status_code: 0 on success, any other value is error
:type status_code: int
:returns: True
:rtype: bool
"""
logg.info('noop callback {} {} {}'.format(result, param, status_code))
return result