diff options
author | Arun Isaac | 2024-01-08 18:31:23 +0000 |
---|---|---|
committer | Arun Isaac | 2024-01-08 18:33:50 +0000 |
commit | c30c6e956903aec533d1824e6fad140084442b40 (patch) | |
tree | 1aa5be9cc841577a5097e27976d4e557e287f48b | |
parent | 2e15351f07522aa88415351c2d919b3329dd4a20 (diff) | |
download | guix-forge-c30c6e956903aec533d1824e6fad140084442b40.tar.gz guix-forge-c30c6e956903aec533d1824e6fad140084442b40.tar.lz guix-forge-c30c6e956903aec533d1824e6fad140084442b40.zip |
gunicorn: Support worker timeout parameter.
* guix/forge/gunicorn.scm (<gunicorn-app>)[timeout]: New field.
* guix/forge/gunicorn.scm (gunicorn-shepherd-services): Pass --timeout
parameter.
* doc/forge.skb (Reference)[Specialized application deployment
services]{gunicorn service}<gunicorn-app>: Document timeout field.
-rw-r--r-- | doc/forge.skb | 5 | ||||
-rw-r--r-- | guix/forge/gunicorn.scm | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/doc/forge.skb b/doc/forge.skb index 3dae6f7..98ae9db 100644 --- a/doc/forge.skb +++ b/doc/forge.skb @@ -1,5 +1,5 @@ ;;; guix-forge --- Guix software forge meta-service -;;; Copyright © 2022, 2023 Arun Isaac <arunisaac@systemreboot.net> +;;; Copyright © 2022–2024 Arun Isaac <arunisaac@systemreboot.net> ;;; ;;; This file is part of guix-forge. ;;; @@ -491,6 +491,9 @@ gunicorn apps to run])) describing sockets to listen on]) (record-field "workers" [Number of worker processes]) + (record-field "timeout" + [Workers silent for more than this many seconds are +killed and restarted.]) (record-field "environment-variables" [List of ,(record-ref "<environment-variable>") objects describing environment variables that should be set in the execution diff --git a/guix/forge/gunicorn.scm b/guix/forge/gunicorn.scm index 9f5b2b2..148bd53 100644 --- a/guix/forge/gunicorn.scm +++ b/guix/forge/gunicorn.scm @@ -1,5 +1,5 @@ ;;; guix-forge --- Guix software forge meta-service -;;; Copyright © 2023 Arun Isaac <arunisaac@systemreboot.net> +;;; Copyright © 2023–2024 Arun Isaac <arunisaac@systemreboot.net> ;;; ;;; This file is part of guix-forge. ;;; @@ -50,6 +50,7 @@ gunicorn-app-wsgi-app-module gunicorn-app-sockets gunicorn-app-workers + gunicorn-app-timeout gunicorn-app-environment-variables gunicorn-app-mappings)) @@ -78,6 +79,8 @@ (default 1)) (environment-variables gunicorn-app-environment-variables (default '())) + (timeout gunicorn-app-timeout + (default 30)) (mappings gunicorn-app-mappings (default '()))) @@ -183,6 +186,7 @@ ;; https://yhetil.org/guix/m1ilknoi5r.fsf@fastmail.net/ #:namespaces (delq 'net %namespaces)) "--workers" #$(number->string (gunicorn-app-workers app)) + "--timeout" #$(number->string (gunicorn-app-timeout app)) (list #$@(append (append-map (lambda (socket) (list "--bind" (socket->gunicorn-bind socket))) |