Trigger reload on openapi schema change
This commit is contained in:
parent
7f9e19a74f
commit
5c6862180b
1 changed files with 7 additions and 4 deletions
|
@ -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 = [
|
||||
(
|
||||
|
|
Loading…
Reference in a new issue