GitLab will be upgraded on June 23rd evening. During the upgrade the service will be unavailable, sorry for the inconvenience.

Commit d93df363 authored by Operator for ID30's avatar Operator for ID30

Added setting of logFile and debugLogFile for MongoDB

parent a0a09861
......@@ -71,5 +71,11 @@ class AbstractActor(object):
actorData=actorData
)
def setMongoAttribute(self, attribute, value):
if self.parent is not None:
if self.parent.mongoId is not None:
UtilsMongoDb.setMongoAttribute(self.parent.mongoId, attribute, value)
def getActorPath(self):
return self.parent.getActorPath()
......@@ -216,6 +216,10 @@ class PythonActor(AbstractActor):
'status': 'finished',
'outData': outData
})
if "workflowLogFile" in outData:
self.setMongoAttribute("logFile", outData["workflowLogFile"])
if "workflowDebugLogFile" in outData:
self.setMongoAttribute("debugLogFile", outData["workflowDebugLogFile"])
for downStreamActor in self.listDownStreamActor:
logger.debug('In trigger {0}, triggering actor {1}, inData={2}'.format(self.name, downStreamActor.name, inData))
downStreamActor.trigger(inData)
......
......@@ -73,6 +73,15 @@ def setMongoStatus(workflowId, status):
collection.update_one({'_id': workflowId}, {"$set": dictWorkflow}, upsert=False)
def setMongoAttribute(workflowId, attribute, value):
mongoUrl = getMongoUrl()
if mongoUrl is not None:
collection = pymongo.MongoClient(mongoUrl).pybes.pybes
dictWorkflow = collection.find_one({'_id': workflowId})
dictWorkflow[attribute] = value
collection.update_one({'_id': workflowId}, {"$set": dictWorkflow}, upsert=False)
def closeMongo(workflowId, status='finished'):
mongoUrl = getMongoUrl()
if mongoUrl is not None:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment