diff --git a/filebridging/client.py b/filebridging/client.py index 23c3284..5fa2ccc 100644 --- a/filebridging/client.py +++ b/filebridging/client.py @@ -399,6 +399,7 @@ class Client: self.print_progress_bar( progress=new_progress, bytes_=bytes_sent, + force=(new_progress == 100) ) print() # New line after progress_bar writer.close() @@ -431,7 +432,8 @@ class Client: ) self.print_progress_bar( progress=new_progress, - bytes_=bytes_received + bytes_=bytes_received, + force=(new_progress == 100) ) if not input_data: break diff --git a/filebridging/server.py b/filebridging/server.py index fc10c64..ca63668 100644 --- a/filebridging/server.py +++ b/filebridging/server.py @@ -82,6 +82,7 @@ class Server: continue input_data = await reader.read(self.buffer_chunk_size) if connection_token not in self.buffers: + print("Here!") break self.buffers[connection_token].append(input_data) except ConnectionResetError as e: diff --git a/filebridging/utilities.py b/filebridging/utilities.py index c7db6c6..a3d2b4c 100644 --- a/filebridging/utilities.py +++ b/filebridging/utilities.py @@ -77,9 +77,9 @@ def timed_action(interval: Union[int, float, datetime.timedelta] = None): timedelta = interval def timer(function_to_time): - def timed_function(*args, **kwargs): + def timed_function(*args, force: bool = False, **kwargs): nonlocal last_call - if now() > last_call + timedelta: + if force or now() > last_call + timedelta: last_call = now() return function_to_time(*args, **kwargs) return