Trigger reload on openapi schema change

This commit is contained in:
Correl Roush 2024-02-21 18:09:48 -05:00
parent 7f9e19a74f
commit 5c6862180b
1 changed files with 7 additions and 4 deletions

View File

@ -419,10 +419,13 @@ class StaticFileHandler(tornado.web.StaticFileHandler):
class Application(tornado.web.Application):
def __init__(self, **settings):
version = importlib.metadata.version(__package__)
settings.setdefault(
"template_path",
importlib.resources.files(__package__) / "templates",
)
template_path = importlib.resources.files(__package__) / "templates"
settings["template_path"] = str(template_path)
if settings.get("autoreload"):
import tornado.autoreload
tornado.autoreload.watch(str(template_path / "openapi.yaml"))
paths = [
(