reana_workflow_controller/consumer.py
def on_message(self, body, message):
        """On new message event handler."""
        message.ack()
        body_dict = json.loads(body)
        workflow_uuid = body_dict.get('workflow_uuid')
        if workflow_uuid:
            status = body_dict.get('status')
            if status:
                status = WorkflowStatus(status)
                print(" [x] Received workflow_uuid: {0} status: {1}".
                      format(workflow_uuid, status))
            logs = body_dict.get('logs') or ''
            _update_workflow_status(workflow_uuid, status, logs)
            if 'message' in body_dict and body_dict.get('message'):
                msg = body_dict['message']
                if 'progress' in msg:
                    _update_run_progress(workflow_uuid, msg)
                    _update_job_progress(workflow_uuid, msg)
                # Caching: calculate input hash and store in JobCache
                if 'caching_info' in msg:
                    _update_job_cache(msg)
                Session.commit()
On new message event handler.
On new message event handler.
On new message event handler .
def on_message(self, body, message):
        message.ack()
        body_dict = json.loads(body)
        workflow_uuid = body_dict.get('workflow_uuid')
        if workflow_uuid:
            status = body_dict.get('status')
            if status:
                status = WorkflowStatus(status)
                print(" [x] Received workflow_uuid: {0} status: {1}".
                      format(workflow_uuid, status))
            logs = body_dict.get('logs') or ''
            _update_workflow_status(workflow_uuid, status, logs)
            if 'message' in body_dict and body_dict.get('message'):
                msg = body_dict['message']
                if 'progress' in msg:
                    _update_run_progress(workflow_uuid, msg)
                    _update_job_progress(workflow_uuid, msg)
                if 'caching_info' in msg:
                    _update_job_cache(msg)
                Session.commit()
def on_message ( self , body , message ) : message . ack ( ) body_dict = json . loads ( body ) workflow_uuid = body_dict . get ( 'workflow_uuid' ) if workflow_uuid : status = body_dict . get ( 'status' ) if status : status = WorkflowStatus ( status ) print ( " [x] Received workflow_uuid: {0} status: {1}" . format ( workflow_uuid , status ) ) logs = body_dict . get ( 'logs' ) or '' _update_workflow_status ( workflow_uuid , status , logs ) if 'message' in body_dict and body_dict . get ( 'message' ) : msg = body_dict [ 'message' ] if 'progress' in msg : _update_run_progress ( workflow_uuid , msg ) _update_job_progress ( workflow_uuid , msg ) if 'caching_info' in msg : _update_job_cache ( msg ) Session . commit ( )
On new message event handler.
On new message event handler .
"""On new message event handler.""" # Caching: calculate input hash and store in JobCache
self
body
message