Skip to content

Commit

Permalink
Merge pull request #120 from dwsutherland/store_reload_bug_fix
Browse files Browse the repository at this point in the history
Fixed reload data-store update bug
  • Loading branch information
hjoliver authored Feb 14, 2020
2 parents 5637c1a + 0dcfed4 commit 1d35ff4
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions cylc/uiserver/data_store_mgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,14 @@ def update_workflow_data(self, topic, delta, w_id):
"""
# wait until data-store is populated for this workflow
loop_cnt = 0
while loop_cnt < self.INIT_DATA_WAIT_TIME:
if w_id not in self.data:
if w_id not in self.data:
loop_cnt = 0
while loop_cnt < self.INIT_DATA_WAIT_TIME:
if w_id in self.data:
break
sleep(self.INIT_DATA_RETRY_DELAY)
loop_cnt += 1
continue
break
if w_id not in self.data:
return
if topic == 'shutdown':
self.workflows_mgr.stopping.add(w_id)
self.w_subs[w_id].stop()
Expand All @@ -145,7 +144,13 @@ def update_workflow_data(self, topic, delta, w_id):
# If the workflow has reloaded recreate the data
# otherwise apply the delta if it's newer than the previously applied.
if delta.reloaded:
self.data[w_id][topic] = {ele.id: ele for ele in delta.deltas}
if topic == WORKFLOW:
self.data[w_id][topic].CopyFrom(delta)
else:
self.data[w_id][topic] = {
ele.id: ele
for ele in delta.deltas
}
self.data[w_id]['delta_times'][topic] = delta_time
elif delta_time >= self.data[w_id]['delta_times'][topic]:
apply_delta(topic, delta, self.data[w_id])
Expand Down

0 comments on commit 1d35ff4

Please sign in to comment.