Good close order.

This commit is contained in:
retoor 2024-12-18 04:27:12 +01:00
parent ab0c4b07c6
commit 4badc7ae7d

View File

@ -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()