Skip to content
Snippets Groups Projects
Commit 05e57566 authored by Jakub Ziebinski's avatar Jakub Ziebinski
Browse files

Get rid of node data update attempt 5 times

parent a75aff23
No related branches found
No related tags found
2 merge requests!399V1.27.5.12 release,!367Implementation of alarm management
......@@ -177,7 +177,6 @@ class Clive(App[int], ManualReactive):
return self.world.profile_data.name == ProfileData.ONBOARDING_PROFILE_NAME or settings.FORCE_ONBOARDING
self.__class__.is_launched = True
self.__amount_of_fails_during_update_node_data = 0
self.console.set_window_title("Clive")
self.update_data_from_node()
......@@ -385,24 +384,15 @@ class Clive(App[int], ManualReactive):
@work(name="node data update worker")
async def update_data_from_node(self) -> None:
allowed_fails_of_update_node_data = 5
accounts = (
self.world.profile_data.get_tracked_accounts()
) # accounts list gonna be empty, but dgpo will be refreshed
wrapper = await self.world.commands.update_node_data(accounts=accounts)
if wrapper.error_occurred:
self.__amount_of_fails_during_update_node_data += 1
logger.warning(
f"Update node data failed {self.__amount_of_fails_during_update_node_data} times: {wrapper.error}"
)
if self.__amount_of_fails_during_update_node_data >= allowed_fails_of_update_node_data:
wrapper.raise_if_error_occurred()
logger.warning(f"Update node data failed: {wrapper.error}")
return
self.__amount_of_fails_during_update_node_data = 0
self.trigger_profile_data_watchers()
self.trigger_app_state_watchers()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment