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

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

Removed redundant inData in the outData uploaded to mongodb

parent 60e8dc89
......@@ -140,6 +140,7 @@ class PythonActor(AbstractActor):
# Import script
module = importlib.import_module(os.path.splitext(script)[0])
self.actorWrapper = ActorWrapper(name, module.run)
self.inData = None
self.outData = None
self.af = None
......@@ -147,6 +148,7 @@ class PythonActor(AbstractActor):
self.listErrorHandler.append(errorHandler)
def trigger(self, inData):
self.inData = inData
self.uploadDataToMongo(actorData={'inData': inData})
logger.debug('In trigger {0}, inData = {1}'.format(self.name, pprint.pformat(inData)))
if isinstance(inData, WorkflowException):
......@@ -211,10 +213,17 @@ class PythonActor(AbstractActor):
logger.error('Trigger on error on errorHandler {0}'.format(self.errorHandler.name))
self.errorHandler.triggerOnError(inData=oldInData)
else:
outData = {}
for key, value in inData.items():
if key in self.inData:
if self.inData[key] != value:
outData[key] = value
else:
outData[key] = value
self.uploadDataToMongo(actorData={
'stopTime': datetime.datetime.utcnow(),
'status': 'finished',
'outData': inData
'outData': outData
})
for downStreamActor in self.listDownStreamActor:
logger.debug('In trigger {0}, triggering actor {1}, inData={2}'.format(self.name, downStreamActor.name, inData))
......
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