Don't reload backend on wwwroot changes.

This commit is contained in:
Leo Vasanko 2023-11-13 00:48:45 -08:00
parent 278e8303c4
commit c321de13fd

View File

@ -1,6 +1,6 @@
import os import os
import re import re
from pathlib import Path, PurePath from pathlib import Path
from sanic import Sanic from sanic import Sanic
@ -15,7 +15,6 @@ def run(*, dev=False):
# Silence Sanic's warning about running in production rather than debug # Silence Sanic's warning about running in production rather than debug
os.environ["SANIC_IGNORE_PRODUCTION_WARNING"] = "1" os.environ["SANIC_IGNORE_PRODUCTION_WARNING"] = "1"
confdir = config.conffile.parent confdir = config.conffile.parent
wwwroot = PurePath(__file__).parent / "wwwroot"
if opts.get("ssl"): if opts.get("ssl"):
# Run plain HTTP redirect/acme server on port 80 # Run plain HTTP redirect/acme server on port 80
server80.app.prepare(port=80, motd=False) server80.app.prepare(port=80, motd=False)
@ -27,7 +26,7 @@ def run(*, dev=False):
motd=False, motd=False,
dev=dev, dev=dev,
auto_reload=dev, auto_reload=dev,
reload_dir={confdir, wwwroot}, reload_dir={confdir},
access_log=True, access_log=True,
) # type: ignore ) # type: ignore
if dev: if dev: