mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-11 13:49:23 -05:00
offload: Prevent locked files from being GC'd.
* guix/scripts/offload.scm (%slots): New variable. (choose-build-machine): Add SLOT to '%slots'.
This commit is contained in:
parent
7df3ade112
commit
5cc569dc73
1 changed files with 8 additions and 1 deletions
|
@ -383,6 +383,10 @@ (define (release-build-slot slot)
|
|||
"Release SLOT, a build slot as returned as by 'acquire-build-slot'."
|
||||
(close-port slot))
|
||||
|
||||
(define %slots
|
||||
;; List of acquired build slots (open ports).
|
||||
'())
|
||||
|
||||
(define (choose-build-machine requirements machines)
|
||||
"Return the best machine among MACHINES fulfilling REQUIREMENTS, or #f."
|
||||
|
||||
|
@ -418,7 +422,10 @@ (define (undecorate pred)
|
|||
|
||||
;; Return the best machine unless it's already overloaded.
|
||||
(if (< (machine-load best) 2.)
|
||||
best
|
||||
(begin
|
||||
;; Prevent SLOT from being GC'd.
|
||||
(set! %slots (cons slot %slots))
|
||||
best)
|
||||
(begin
|
||||
(release-build-slot slot)
|
||||
#f)))
|
||||
|
|
Loading…
Reference in a new issue