Ejemplo n.º 1
0
 def getStatus( self, rid: str ) -> Dict[str,str]:
     workflow = self.app.getWorkflow(rid)
     if workflow is None:
         if rid in self.app.registeredRequests:  return { "status": Status.str( Status.IDLE  ), "rid": rid }
         else:                                   return { "status": Status.str( Status.ERROR ), "rid": rid, "message": "Unknown request: " + rid }
     else:
         status = workflow.status()
         result = { "status": Status.str( status ), "rid": rid }
         if status == Status.ERROR:
             result["message"] = str( workflow.getResult().exception() )
         self.logger.info( f"REST-SERVER: getStatus(rid={rid}): {str(result)}, all tasks: {self.app.getWorkflows().keys()}" )
         return result
Ejemplo n.º 2
0
 def getStatusMap(self) -> Dict:
     response = {}
     for rid, workflow in self.app.getWorkflows().items():
         status = workflow.status()
         result = {"status": Status.str(status), "rid": rid}
         if status == Status.ERROR:
             result["message"] = str(workflow.getResult().exception())
         self.logger.info(
             f"REST-SERVER: getStatus(rid={rid}): {str(result)}, all tasks: {self.app.getWorkflows().keys()}"
         )
         response[rid] = result
     return response