1
0
mirror of https://github.com/dkmstr/openuds.git synced 2025-01-12 09:17:56 +03:00

added uvloop support

This commit is contained in:
Adolfo Gómez García 2022-12-07 20:08:27 +01:00
parent a7f853925a
commit ffe2e33fa0
No known key found for this signature in database
GPG Key ID: DD1ABF20724CDA23

View File

@ -41,7 +41,16 @@ import logging
from concurrent.futures import ThreadPoolExecutor
import typing
import setproctitle
try:
import uvloop
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
except ImportError:
pass # no uvloop support
try:
import setproctitle
except ImportError:
setproctitle = None # type: ignore
from uds_tunnel import config, proxy, consts, processes, stats
@ -202,7 +211,8 @@ def tunnel_main() -> None:
logger.info(
'Starting tunnel server on %s:%s', cfg.listen_address, cfg.listen_port
)
setproctitle.setproctitle(f'UDSTunnel {cfg.listen_address}:{cfg.listen_port}')
if setproctitle:
setproctitle.setproctitle(f'UDSTunnel {cfg.listen_address}:{cfg.listen_port}')
# Create pid file
if cfg.pidfile: