From 8f903cc2cda4d7cf6cc3f999168463d1ed836684 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Thu, 7 Apr 2022 15:02:41 +0800 Subject: [PATCH] bugfix --- ahserver/configuredServer.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/ahserver/configuredServer.py b/ahserver/configuredServer.py index 0fa98ed..0c09664 100644 --- a/ahserver/configuredServer.py +++ b/ahserver/configuredServer.py @@ -20,13 +20,14 @@ except: pmp = None class ConfiguredServer: - def __init__(self,auth_klass=AuthAPI): - pp = ProgramPath() - self.natpmp_loop = True - self.nat_heartbeat = False - workdir = pp - if len(sys.argv) > 1: - workdir = sys.argv[1] + def __init__(self,auth_klass=AuthAPI, workdir=None): + if workdir is None: + pp = ProgramPath() + self.natpmp_loop = True + self.nat_heartbeat = False + workdir = pp + if len(sys.argv) > 1: + workdir = sys.argv[1] config = getConfig(workdir,{'workdir':workdir,'ProgramPath':pp}) if config.databases: DBPools(config.databases)