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/06/20 08:51:18 UTC

incubator-ariatosca git commit: fixed logging issue

Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-236-Resumable-workflow-executions 4d74419e9 -> f75b9ae7b


fixed logging issue


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/f75b9ae7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/f75b9ae7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/f75b9ae7

Branch: refs/heads/ARIA-236-Resumable-workflow-executions
Commit: f75b9ae7b2afe975cd08c6e7416011093da990e5
Parents: 4d74419
Author: max-orlov <ma...@gigaspaces.com>
Authored: Tue Jun 20 11:51:14 2017 +0300
Committer: max-orlov <ma...@gigaspaces.com>
Committed: Tue Jun 20 11:51:14 2017 +0300

----------------------------------------------------------------------
 aria/cli/commands/executions.py | 5 ++++-
 aria/cli/logger.py              | 4 ++--
 2 files changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/f75b9ae7/aria/cli/commands/executions.py
----------------------------------------------------------------------
diff --git a/aria/cli/commands/executions.py b/aria/cli/commands/executions.py
index cfa211e..f2f8221 100644
--- a/aria/cli/commands/executions.py
+++ b/aria/cli/commands/executions.py
@@ -187,7 +187,10 @@ def _run_execution(workflow_runner, logger, model_storage, dry, mark_pattern):
     logger.info('Starting {0}execution. Press Ctrl+C cancel'.format('dry ' if dry else ''))
     execution_thread.start()
 
-    log_iterator = cli_logger.ModelLogIterator(model_storage, workflow_runner.execution_id)
+    last_task_id = workflow_runner.execution.logs[-1].id if workflow_runner.execution.logs else 0
+    log_iterator = cli_logger.ModelLogIterator(model_storage,
+                                               workflow_runner.execution_id,
+                                               offset=last_task_id)
     try:
         while execution_thread.is_alive():
             execution_logging.log_list(log_iterator, mark_pattern=mark_pattern)

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/f75b9ae7/aria/cli/logger.py
----------------------------------------------------------------------
diff --git a/aria/cli/logger.py b/aria/cli/logger.py
index 5de3701..96f3fb3 100644
--- a/aria/cli/logger.py
+++ b/aria/cli/logger.py
@@ -115,8 +115,8 @@ class Logging(object):
 
 class ModelLogIterator(object):
 
-    def __init__(self, model_storage, execution_id, filters=None, sort=None):
-        self._last_visited_id = 0
+    def __init__(self, model_storage, execution_id, filters=None, sort=None, offset=0):
+        self._last_visited_id = offset
         self._model_storage = model_storage
         self._execution_id = execution_id
         self._additional_filters = filters or {}