You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ariatosca.apache.org by mx...@apache.org on 2017/05/04 15:26:16 UTC
incubator-ariatosca git commit: smarten up the model task retrieval
mechanism
Repository: incubator-ariatosca
Updated Branches:
refs/heads/ARIA-160-Operation-toolbelt-unit-tests-fail-spordically 0c3c2df2c -> fe0348990
smarten up the model task retrieval mechanism
Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/fe034899
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/fe034899
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/fe034899
Branch: refs/heads/ARIA-160-Operation-toolbelt-unit-tests-fail-spordically
Commit: fe0348990337a0dcb918d7179f56463ad68f496c
Parents: 0c3c2df
Author: max-orlov <ma...@gigaspaces.com>
Authored: Thu May 4 18:26:12 2017 +0300
Committer: max-orlov <ma...@gigaspaces.com>
Committed: Thu May 4 18:26:12 2017 +0300
----------------------------------------------------------------------
aria/orchestrator/workflows/core/task.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/fe034899/aria/orchestrator/workflows/core/task.py
----------------------------------------------------------------------
diff --git a/aria/orchestrator/workflows/core/task.py b/aria/orchestrator/workflows/core/task.py
index 8adeb7e..e90b1b6 100644
--- a/aria/orchestrator/workflows/core/task.py
+++ b/aria/orchestrator/workflows/core/task.py
@@ -152,6 +152,7 @@ class OperationTask(BaseTask):
workdir=self._workflow_context._workdir)
self._task_id = task_model.id
self._update_fields = None
+ self._model_task = None
@contextmanager
def _update(self):
@@ -175,11 +176,15 @@ class OperationTask(BaseTask):
Returns the task model in storage
:return: task in storage
"""
- return self._workflow_context.model.task.get(self._task_id)
+ if self._model_task is None:
+ self._model_task = self._workflow_context.model.task.get(self._task_id)
+ return self._model_task
@model_task.setter
def model_task(self, value):
+ self._model_task = None
self._workflow_context.model.task.put(value)
+ self._workflow_context.model.task.refresh(value)
@property
def context(self):