civodul pushed a commit to branch master in repository maintenance. commit d2e5156ef84410acf0e6dd1e322fc28947806bd7 Author: Ludovic Courtès <l...@gnu.org> AuthorDate: Fri Apr 4 11:37:42 2025 +0200
hydra: static-web-site: Timers have a max duration. * hydra/modules/sysadmin/web.scm (build-program): Remove #:max-duration. [build]: Remove ‘timestamp’, ‘alarm-handler’, and their references. (static-web-site-shepherd-services)[update]: Remove #:max-duration argument. Pass #:max-duration to ‘make-timer-constructor’. --- hydra/modules/sysadmin/web.scm | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/hydra/modules/sysadmin/web.scm b/hydra/modules/sysadmin/web.scm index 76716fff..52ec89d1 100644 --- a/hydra/modules/sysadmin/web.scm +++ b/hydra/modules/sysadmin/web.scm @@ -57,7 +57,6 @@ (define* (build-program url root #:key - (max-duration 3600) (file "guix.scm") (ref '(branch . "master")) (name "build-program") @@ -111,23 +110,7 @@ that's built with Haunt or similar." variables) (primitive-load (string-append checkout "/" #$file)))) - (define (timestamp) - (date->string (time-utc->date (current-time time-utc)) - "[~4]")) - - (define (alarm-handler . _) - (format #t "~a time is up, aborting web site update~%" - (timestamp)) - (exit 1)) - - ;; Since this program typically runs periodically, abort after - ;; MAX-DURATION to avoid spending countless instances of it when, - ;; for example, the GC lock is held. - (sigaction SIGALRM alarm-handler) - (alarm #$max-duration) - - (format #t "~a building web site from '~a'...~%" - (timestamp) #$url) + (format #t "building web site from '~a'...~%" #$url) (with-store store (run-with-store store @@ -166,7 +149,6 @@ that's built with Haunt or similar." (define (update config) (build-program (static-web-site-configuration-git-url config) (static-web-site-configuration-directory config) - #:max-duration (static-web-site-configuration-period config) #:file (static-web-site-configuration-build-file config) #:ref (static-web-site-configuration-git-ref config) #:environment-variables @@ -223,6 +205,7 @@ that's built with Haunt or similar." #:user "static-web-site" #:group "static-web-site") #:wait-for-termination? #t + #:max-duration #$(static-web-site-configuration-period config) #:log-file #$(string-append "/var/log/static-web-sites/" name ".log"))) (stop #~(make-timer-destructor))