Skip to content
Merged
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
15 changes: 6 additions & 9 deletions client/ayon_sitesync/providers/sftp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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":
Expand All @@ -370,13 +368,12 @@ 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))
self.log.debug(f"{direction}ed {int(status_val * 100)}%.")
server.update_db(
project_name=project_name,
new_file_id=None,
Expand Down
Loading