From dcb45127e01ce2eeabc9270b64e817aa1d644672 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 7 Nov 2018 16:01:17 +0100 Subject: services: cuirass: Add 'ttl' configuration field. * gnu/services/cuirass.scm ()[ttl]: New field. (cuirass-shepherd-service): Honor it. --- doc/guix.texi | 5 +++++ gnu/services/cuirass.scm | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index 53aee4a14f..d021875bbf 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -18672,6 +18672,11 @@ Cuirass jobs. Location of sqlite database which contains the build results and previously added specifications. +@item @code{ttl} (default: @code{(* 30 24 3600)}) +Specifies the time-to-live (TTL) in seconds of garbage collector roots that +are registered for build results. This means that build results are protected +from garbage collection for at least @var{ttl} seconds. + @item @code{port} (default: @code{8081}) Port number used by the HTTP server. diff --git a/gnu/services/cuirass.scm b/gnu/services/cuirass.scm index 496b2d06c8..36e90fc825 100644 --- a/gnu/services/cuirass.scm +++ b/gnu/services/cuirass.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2016 Mathieu Lirzin -;;; Copyright © 2016, 2017 Ludovic Courtès +;;; Copyright © 2016, 2017, 2018 Ludovic Courtès ;;; Copyright © 2017 Mathieu Othacehe ;;; Copyright © 2017 Jan Nieuwenhuizen ;;; Copyright © 2018 Ricardo Wurmus @@ -54,6 +54,8 @@ (define-record-type* (default "/var/log/cuirass.log")) (cache-directory cuirass-configuration-cache-directory ;string (dir-name) (default "/var/cache/cuirass")) + (ttl cuirass-configuration-ttl ;integer + (default (* 30 24 3600))) (user cuirass-configuration-user ;string (default "cuirass")) (group cuirass-configuration-group ;string @@ -86,6 +88,7 @@ (define (cuirass-shepherd-service config) (group (cuirass-configuration-group config)) (interval (cuirass-configuration-interval config)) (database (cuirass-configuration-database config)) + (ttl (cuirass-configuration-ttl config)) (port (cuirass-configuration-port config)) (host (cuirass-configuration-host config)) (specs (cuirass-configuration-specifications config)) @@ -102,6 +105,7 @@ (define (cuirass-shepherd-service config) "--specifications" #$(scheme-file "cuirass-specs.scm" specs) "--database" #$database + "--ttl" #$(string-append (number->string ttl) "s") "--port" #$(number->string port) "--listen" #$host "--interval" #$(number->string interval) -- cgit v1.2.3