gunicorn issue

This commit is contained in:
2026-08-09 17:07:38 +02:00
parent 0326db91da
commit b477737bad
2 changed files with 7 additions and 1 deletions
+1 -1
View File
@@ -151,7 +151,7 @@ WorkingDirectory=/srv/fasthue
Environment=FASTHUE_SECRETS_FILE=/etc/fasthue/secrets.yaml Environment=FASTHUE_SECRETS_FILE=/etc/fasthue/secrets.yaml
RuntimeDirectory=fasthue RuntimeDirectory=fasthue
RuntimeDirectoryMode=0750 RuntimeDirectoryMode=0750
ExecStart=/srv/fasthue/.venv/bin/gunicorn --workers 1 --umask 007 --bind unix:/run/fasthue/fasthue.sock --factory app:create_gunicorn_app ExecStart=/srv/fasthue/.venv/bin/gunicorn --workers 1 --umask 007 --bind unix:/run/fasthue/fasthue.sock app:gunicorn_app
Restart=on-failure Restart=on-failure
RestartSec=3 RestartSec=3
+6
View File
@@ -234,6 +234,12 @@ def create_gunicorn_app() -> Flask:
return create_app(config_path, verify_tls, api_key, configured_url_prefix()) return create_app(config_path, verify_tls, api_key, configured_url_prefix())
# Older Gunicorn releases do not support --factory. Expose a WSGI callable at
# import time so they can load this application with `app:gunicorn_app`.
if __name__ != "__main__":
gunicorn_app = create_gunicorn_app()
def main() -> None: def main() -> None:
parser = argparse.ArgumentParser(description=__doc__) parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--config", type=Path, default=ROOT / "hue.yaml", help="Dashboard YAML file") parser.add_argument("--config", type=Path, default=ROOT / "hue.yaml", help="Dashboard YAML file")