From d6e79d057acdaddf63d7107793ce09d338b3a005 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 19 Feb 2019 14:10:06 +0800 Subject: [PATCH] Update setting.py --- setting.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/setting.py b/setting.py index 7f894025b..1b35d7180 100755 --- a/setting.py +++ b/setting.py @@ -12,15 +12,21 @@ import system_api # cpu_info = system_api.system_api().getCpuInfo() # workers = cpu_info[1] + 1 -workers = 2 if not os.path.exists(os.getcwd() + '/logs'): os.mkdir(os.getcwd() + '/logs') -bt_port = public.readFile('data/port.pl') -bind = ['0.0.0.0:%s' % bt_port] +mw_port = public.readFile('data/port.pl') +if mw_port: + mw_port.strip() +bind = [] +if os.path.exists('data/ipv6.pl'): + bind.append('[0:0:0:0:0:0:0:0]:%s' % mw_port) +else: + bind.append('0.0.0.0:%s' % mw_port) +workers = 1 threads = 4 backlog = 512 reload = False