Skip to content
Snippets Groups Projects

Async guard

Merged Mateusz Żebrak requested to merge mzebrak/async-guard into develop
All threads resolved!
3 files
+ 13
19
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -43,21 +43,12 @@ class CreateProfileForm(Form):
self.app.run_worker(impl())
async def finish_form(self) -> None:
async def handle_modes() -> None:
await self.app.switch_mode("dashboard")
await self.app.remove_mode("create_profile")
await self.app.remove_mode("unlock")
async def impl() -> None:
with self._async_guard:
self.add_post_action(
lambda: self.app.update_alarms_data_on_newest_node_data(suppress_cancelled_error=True),
self.app.resume_refresh_alarms_data_interval,
)
await self.execute_post_actions()
await handle_modes()
self.profile.enable_saving()
await self.commands.save_profile()
await self.app._switch_mode_into_unlocked()
if self._async_guard.is_available:
# Has to be done in a separate task to avoid deadlock.
Loading