This commit is contained in:
yumoqing 2021-06-26 21:57:12 +08:00
parent 2c57d614d3
commit bd32b8205e
2 changed files with 6 additions and 2 deletions

View File

@ -14,7 +14,10 @@ from .processorResource import ProcessorResource
from .auth_api import AuthAPI
from .myTE import setupTemplateEngine
from .globalEnv import initEnv
from natpmp import NATPMP as pmp
try:
from natpmp import NATPMP as pmp
except:
pmp = None
class ConfiguredServer:
def __init__(self,auth_klass=AuthAPI):
@ -69,7 +72,7 @@ class ConfiguredServer:
ssl_context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
ssl_context.load_cert_chain(config.website.ssl.crtfile,
config.website.ssl.keyfile)
if config.natpmp:
if pmp and config.natpmp:
self.nat_heartbeat = True
b = Background(self.natpmp_heartbeat)
b.start()

View File

@ -12,3 +12,4 @@ jinja2
ujson
openpyxl
pillow
py-natpmp