Skip to content

Commit

Permalink
Tidy/fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
MetRonnie committed Nov 23, 2021
1 parent 740a57b commit 5100aba
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions cylc/uiserver/data_store_mgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,24 +382,22 @@ async def entire_workflow_update(self, ids: Optional[list] = None) -> None:
results = await asyncio.gather(
*requests.values(), return_exceptions=True
)
# result:
for w_id, result in zip(requests, results):
if isinstance(result, Exception):
self.log.exception(
'Failed to update entire local data-store '
'of a workflow', exc_info=result
)
elif result is not None and result != MSG_TIMEOUT:
pb_data = PB_METHOD_MAP[req_method]()
pb_data.ParseFromString(result)
new_data = deepcopy(DATA_TEMPLATE)
for field, value in pb_data.ListFields():
if field.name == WORKFLOW:
new_data[field.name].CopyFrom(value)
new_data['delta_times'] = {
key: value.last_updated
for key in DATA_TEMPLATE
}
continue
new_data[field.name] = {n.id: n for n in value}
self.data[w_id] = new_data
pb_data = PB_METHOD_MAP[req_method]()
pb_data.ParseFromString(result)
new_data = deepcopy(DATA_TEMPLATE)
for field, value in pb_data.ListFields():
if field.name == WORKFLOW:
new_data[field.name].CopyFrom(value)
new_data['delta_times'] = {
key: value.last_updated
for key in DATA_TEMPLATE
}
continue
new_data[field.name] = {n.id: n for n in value}
self.data[w_id] = new_data

0 comments on commit 5100aba

Please sign in to comment.