diff --git a/src/zamenyat/app.py b/src/zamenyat/app.py index 0657ee3..65f8869 100644 --- a/src/zamenyat/app.py +++ b/src/zamenyat/app.py @@ -175,7 +175,7 @@ class Application: while True: time_start = time.time() - print(f"Connected to upstream #{self.total_connection_count} server {self.upstream_host}:{self.upstream_port} #{connection_nr} Time: {get_timestamp()}") + print(f"Connected to upstream #{connection_nr} server {self.upstream_host}:{self.upstream_port} #{self.connection_count} Time: {get_timestamp()}") if is_websocket: await asyncio.gather( @@ -196,7 +196,7 @@ class Application: time_end = time.time() time_duration = time_end - time_start - print(f"Disconnected upstream #{self.total_connection_count} server {self.upstream_host}:{self.upstream_port} #{connection_nr} Duration: {time_duration:.5f}s") + print(f"Disconnected upstream #{connection_nr} server {self.upstream_host}:{self.upstream_port} #{self.connection_count} Duration: {time_duration:.5f}s") if not any([keep_alive, is_websocket]): @@ -205,10 +205,13 @@ class Application: self.connection_count -= 1 writer.close() - await writer.wait_closed() upstream_writer.close() + await writer.wait_closed() await upstream_writer.wait_closed() + + + def upgrade_executor(self, thread_count): self.executor = Executor(max_workers=thread_count) loop = asyncio.get_running_loop()