From 27f3de263aa8d001e425aa1bf871195296f7da26 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 24 Apr 2026 12:03:09 +0200 Subject: [PATCH 1/3] fix formatting --- client/ayon_sitesync/providers/sftp.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/client/ayon_sitesync/providers/sftp.py b/client/ayon_sitesync/providers/sftp.py index 3dd53ea..ecbc385 100644 --- a/client/ayon_sitesync/providers/sftp.py +++ b/client/ayon_sitesync/providers/sftp.py @@ -332,7 +332,7 @@ def _get_conn(self): raise ValueError( f"Certificate at '{key_paths}' doesn't exist." ) - + if self.sftp_key_pass: conn_params["private_key_pass"] = self.sftp_key_pass @@ -355,11 +355,9 @@ def _mark_progress( target_path, direction ): - """ - Updates progress field in DB by values 0-1. - + """Updates progress field in DB by values 0-1. - Compares file sizes of source and target. + Compares file sizes of source and target. """ pass if direction == "upload": From 00c842ccb7d5492d1c982c6d360c42be8456f649 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 24 Apr 2026 12:03:19 +0200 Subject: [PATCH 2/3] better last tick handling --- client/ayon_sitesync/providers/sftp.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/client/ayon_sitesync/providers/sftp.py b/client/ayon_sitesync/providers/sftp.py index ecbc385..2b87eb2 100644 --- a/client/ayon_sitesync/providers/sftp.py +++ b/client/ayon_sitesync/providers/sftp.py @@ -368,10 +368,9 @@ def _mark_progress( source_file_size = self.conn.stat(source_path).st_size target_file_size = 0 - last_tick = status_val = None + last_tick = 0 while source_file_size != target_file_size: - if not last_tick or \ - time.time() - last_tick >= server.LOG_PROGRESS_SEC: + if time.time() - last_tick >= server.LOG_PROGRESS_SEC: status_val = target_file_size / source_file_size last_tick = time.time() self.log.debug(direction + "ed %d%%." % int(status_val * 100)) From 5031bf4814dc242e585c3587f0459ccc6124e928 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 24 Apr 2026 12:03:55 +0200 Subject: [PATCH 3/3] better string interpolation --- client/ayon_sitesync/providers/sftp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_sitesync/providers/sftp.py b/client/ayon_sitesync/providers/sftp.py index 2b87eb2..2603372 100644 --- a/client/ayon_sitesync/providers/sftp.py +++ b/client/ayon_sitesync/providers/sftp.py @@ -373,7 +373,7 @@ def _mark_progress( if time.time() - last_tick >= server.LOG_PROGRESS_SEC: status_val = target_file_size / source_file_size last_tick = time.time() - self.log.debug(direction + "ed %d%%." % int(status_val * 100)) + self.log.debug(f"{direction}ed {int(status_val * 100)}%.") server.update_db( project_name=project_name, new_file_id=None,