Fixed update check

This commit is contained in:
Your Name 2025-05-02 00:18:21 +01:00
parent 8c877a8b0a
commit c4da55a4f9

View file

@ -223,13 +223,13 @@ class WorkerThread(QThread):
def sync(self): def sync(self):
try: try:
print('inside syns workertheard')
if self.action == 'SYNC_TOR': if self.action == 'SYNC_TOR':
ConfigurationController.set_connection('tor') ConfigurationController.set_connection('tor')
else: else:
ConfigurationController.set_connection('system') ConfigurationController.set_connection('system')
ClientController.sync(client_observer=client_observer, connection_observer=connection_observer) ClientController.sync(client_observer=client_observer, connection_observer=connection_observer)
locations = LocationController.get_all() locations = LocationController.get_all()
print(locations)
all_location_codes = [f"{location.country_code}_{location.code}" for location in locations] all_location_codes = [f"{location.country_code}_{location.code}" for location in locations]
self.sync_output.emit(all_location_codes, True, False, locations, False) self.sync_output.emit(all_location_codes, True, False, locations, False)
except Exception as e: except Exception as e:
@ -1060,6 +1060,7 @@ class Worker(QObject):
self.force = self.profile_data.get('force', False) self.force = self.profile_data.get('force', False)
def run(self): def run(self):
print('inside enable worker thread')
self.profile = ProfileController.get(int(self.profile_data['id'])) self.profile = ProfileController.get(int(self.profile_data['id']))
if 'billing_code' in self.profile_data: if 'billing_code' in self.profile_data:
@ -1089,6 +1090,7 @@ class Worker(QObject):
except CommandNotFoundError as e : except CommandNotFoundError as e :
self.update_signal.emit(str(e), False, -1, None, None) self.update_signal.emit(str(e), False, -1, None, None)
except Exception as e: except Exception as e:
print('exception inside thread')
print(e) print(e)
self.update_signal.emit("An unknown error occurred", False, None, None, None) self.update_signal.emit("An unknown error occurred", False, None, None, None)
@ -5671,7 +5673,7 @@ class SyncScreen(Page):
update_available = ClientController.can_be_updated() update_available = ClientController.can_be_updated()
if not update_available: if update_available:
menu_page = self.page_stack.findChild(MenuPage) menu_page = self.page_stack.findChild(MenuPage)
menu_page.on_update_check_finished() menu_page.on_update_check_finished()