diff options
author | 2019-04-02 10:32:20 +0000 | |
---|---|---|
committer | 2019-04-02 10:32:20 +0000 | |
commit | 56b4c5cefb65f1cb76445a621087a3f4ab2fc3e9 (patch) | |
tree | bc1aa34c136b8fdba37468e7ea462c5f9629ca85 /share/common/msapi | |
parent | feec0bcd53f24b0383f9f2db3a7837fa08525947 (diff) |
Integrate heatbridge logic to infra_workload API
Offload the heatbridge to thread
Change-Id: I66c32e7ee30a40542e6ba75087d7d88caaf0c640
Issue-ID: MULTICLOUD-561
Signed-off-by: Bin Yang <bin.yang@windriver.com>
Diffstat (limited to 'share/common/msapi')
-rw-r--r-- | share/common/msapi/helper.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/share/common/msapi/helper.py b/share/common/msapi/helper.py index 979c7feb..48626cc9 100644 --- a/share/common/msapi/helper.py +++ b/share/common/msapi/helper.py @@ -180,6 +180,7 @@ class MultiCloudThreadHelper(object): # "payload": opaque object to pass to the worker for processing # "repeat": interval in micro-seconds for repeating this worker, 0 for one time worker # "timestamp": time stamp of last invocation of this worker, 0 for initial state + # "status": opaque object to represent the progress of the backlog processing # } # format of backlog: # {"<id value of backlog item>": <backlog item>, ...} @@ -266,11 +267,12 @@ class MultiCloudThreadHelper(object): item["status"] = worker(payload) or 0 except Exception as e: item["status"] = e.message - item["timestamp"] = now if item.get("repeat", 0) == 0: self.owner.remove(backlog_id) - self.owner.expired_backlog[backlog_id] = item - pass + # keep only the id and status + self.owner.expired_backlog[backlog_id] = {"status": item["status"]} + else: + item["timestamp"] = now pass # end of loop logger.debug("stop processing backlogs") |