Make the job timeout configurable
This commit is contained in:
parent
131967dc39
commit
37b7c568ed
2 changed files with 20 additions and 10 deletions
|
|
@ -147,7 +147,9 @@ WHERE load_new_guix_revision_jobs.id = $1"
|
|||
ignore-systems
|
||||
ignore-targets
|
||||
(free-space-requirement
|
||||
(* 2 (expt 2 30)))) ; 2G
|
||||
;; 2G
|
||||
(* 2 (expt 2 30)))
|
||||
timeout)
|
||||
(define (fetch-new-jobs)
|
||||
(let ((free-space (free-disk-space "/gnu/store")))
|
||||
(if (< free-space free-space-requirement)
|
||||
|
|
@ -204,7 +206,8 @@ WHERE load_new_guix_revision_jobs.id = $1"
|
|||
handle-job-failure
|
||||
#:max-processes max-processes
|
||||
#:priority-max-processes
|
||||
latest-branch-revision-max-processes))
|
||||
latest-branch-revision-max-processes
|
||||
#:timeout timeout))
|
||||
|
||||
|
||||
(define* (log-for-job conn job-id
|
||||
|
|
@ -312,10 +315,6 @@ WHERE job_id = $1")
|
|||
4))
|
||||
1))
|
||||
|
||||
(define default-timeout
|
||||
(* (* 60 60) ;; 1 hour in seconds
|
||||
72))
|
||||
|
||||
(define* (process-jobs-concurrently
|
||||
fetch-new-jobs
|
||||
process-job
|
||||
|
|
@ -324,7 +323,7 @@ WHERE job_id = $1")
|
|||
#:key
|
||||
(max-processes default-max-processes)
|
||||
(priority-max-processes (* 2 max-processes))
|
||||
(timeout default-timeout))
|
||||
timeout)
|
||||
|
||||
(define processes
|
||||
(make-hash-table))
|
||||
|
|
@ -424,7 +423,8 @@ WHERE job_id = $1")
|
|||
(atomic-box-set! exit? #t)))
|
||||
|
||||
(while #t
|
||||
(kill-long-running-processes)
|
||||
(when timeout
|
||||
(kill-long-running-processes))
|
||||
(wait-on-processes)
|
||||
(display-status)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue