From 3fae370e4cce134a56118535c15711ebf2868032 Mon Sep 17 00:00:00 2001 From: drew2a Date: Mon, 1 May 2023 12:18:11 +0200 Subject: [PATCH] Skip the upgrade procedure if possible --- src/tribler/gui/upgrade_manager.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/tribler/gui/upgrade_manager.py b/src/tribler/gui/upgrade_manager.py index 1ddb8a1b9e6..e62526df52e 100644 --- a/src/tribler/gui/upgrade_manager.py +++ b/src/tribler/gui/upgrade_manager.py @@ -147,10 +147,6 @@ def _show_message_box(title, body, icon, standard_buttons, default_button, addit def should_cleanup_old_versions(self) -> List[TriblerVersion]: self._logger.info('Should cleanup old versions') - if self.version_history.last_run_version == self.version_history.code_version: - self._logger.info('Last run version is the same as the current version. Exit cleanup procedure.') - return [] - disposable_versions = self.version_history.get_disposable_versions(skip_versions=2) if not disposable_versions: self._logger.info('No disposable versions. Exit cleanup procedure.') @@ -188,6 +184,11 @@ def should_cleanup_old_versions(self) -> List[TriblerVersion]: return [] def start(self): + if self.version_history.last_run_version == self.version_history.code_version: + self._logger.info('Last run version is the same as the current version. Skip upgrade.') + self.upgrader_finished.emit() + return + self._logger.info('Start upgrade process') last_version = self.version_history.last_run_version if last_version and last_version.is_ancient(self.last_supported_version):