fix(forge): Make watchfiles pattern more specific to prevent unwanted (breaking) reloads

This fixes the issue of changes in artifacts triggering an application reload (which caused connection errors for in-progress requests).
This commit is contained in:
Reinier van der Leer
2024-02-15 13:42:38 +01:00
parent a9b7b175ff
commit 8762f7ab3d

View File

@@ -45,5 +45,13 @@ if __name__ == "__main__":
host="localhost",
port=int(port),
log_level="error",
# Reload on changes to code or .env
reload=True,
reload_dirs=os.path.dirname(os.path.dirname(__file__)),
reload_excludes="*.py", # Cancel default *.py include pattern
reload_includes=[
f"{os.path.basename(os.path.dirname(__file__))}/**/*.py",
".*",
".env",
],
)