Good close order.
This commit is contained in:
parent
ab0c4b07c6
commit
4badc7ae7d
@ -175,7 +175,7 @@ class Application:
|
|||||||
|
|
||||||
while True:
|
while True:
|
||||||
time_start = time.time()
|
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:
|
if is_websocket:
|
||||||
await asyncio.gather(
|
await asyncio.gather(
|
||||||
@ -196,7 +196,7 @@ class Application:
|
|||||||
|
|
||||||
time_end = time.time()
|
time_end = time.time()
|
||||||
time_duration = time_end - time_start
|
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]):
|
if not any([keep_alive, is_websocket]):
|
||||||
@ -205,10 +205,13 @@ class Application:
|
|||||||
self.connection_count -= 1
|
self.connection_count -= 1
|
||||||
|
|
||||||
writer.close()
|
writer.close()
|
||||||
await writer.wait_closed()
|
|
||||||
upstream_writer.close()
|
upstream_writer.close()
|
||||||
|
await writer.wait_closed()
|
||||||
await upstream_writer.wait_closed()
|
await upstream_writer.wait_closed()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def upgrade_executor(self, thread_count):
|
def upgrade_executor(self, thread_count):
|
||||||
self.executor = Executor(max_workers=thread_count)
|
self.executor = Executor(max_workers=thread_count)
|
||||||
loop = asyncio.get_running_loop()
|
loop = asyncio.get_running_loop()
|
||||||
|
Loading…
Reference in New Issue
Block a user