cic-internal-integration/apps/cic-eth/cic_eth/callbacks/noop.py

25 lines
739 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 logging
import celery
celery_app = celery.current_app
#logg = celery_app.log.get_default_logger()
logg = logging.getLogger()
@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