def bind_on_status_change(new_status, job_id): job_id = job_id or 'unknown' try: message = "Publishing Pulsar state change with status %s for job_id %s" % (new_status, job_id) log.debug(message) payload = manager_endpoint_util.full_status(manager, new_status, job_id) pulsar_exchange.publish("status_update", payload) except: log.exception("Failure to publish Pulsar state change for job_id %s." % job_id) raise
def status(manager, job_id): status = manager.get_status(job_id) return full_status(manager, status, job_id)