Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip the upgrade procedure if it isn't necessary #7397

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/tribler/gui/upgrade_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.')
Expand Down Expand Up @@ -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):
Expand Down