Update use of resource pools
This commit is contained in:
parent
9bf4eea2fd
commit
258ee0468b
4 changed files with 22 additions and 31 deletions
|
|
@ -1905,8 +1905,7 @@ SELECT 1 FROM derivation_source_file_nars WHERE derivation_source_file_id = $1"
|
|||
'load-new-guix-revision-inserts))
|
||||
db-conn)
|
||||
1
|
||||
#:name "postgres"
|
||||
#:min-size 0))
|
||||
#:name "postgres"))
|
||||
|
||||
(define package-ids-promise
|
||||
(fibers-delay
|
||||
|
|
@ -2265,8 +2264,7 @@ SELECT 1 FROM derivation_source_file_nars WHERE derivation_source_file_id = $1"
|
|||
(make-resource-pool
|
||||
(const channel-instances-conn)
|
||||
1
|
||||
#:name "postgres"
|
||||
#:min-size 0)))
|
||||
#:name "postgres")))
|
||||
|
||||
(unless existing-guix-revision-id
|
||||
(let* ((derivations-by-system
|
||||
|
|
@ -2843,8 +2841,6 @@ SKIP LOCKED")
|
|||
|
||||
(%thread-pool-default-timeout #f)
|
||||
|
||||
(resource-pool-retry-checkout-timeout 120)
|
||||
|
||||
(add-hook! after-gc-hook
|
||||
(lambda ()
|
||||
(simple-format (current-error-port)
|
||||
|
|
|
|||
|
|
@ -125,25 +125,23 @@
|
|||
(define (spawn-fiber-for-handler handler)
|
||||
(spawn-fiber
|
||||
(lambda ()
|
||||
(parameterize
|
||||
((resource-pool-retry-checkout-timeout (* 60 60 6)))
|
||||
(call-with-resource-from-pool (background-connection-pool)
|
||||
(lambda (conn)
|
||||
(with-exception-handler
|
||||
(lambda (exn)
|
||||
(simple-format
|
||||
(current-error-port)
|
||||
"exception in build event handler: ~A\n"
|
||||
exn))
|
||||
(lambda ()
|
||||
(with-throw-handler #t
|
||||
(lambda ()
|
||||
(handler conn))
|
||||
(lambda _
|
||||
(display (backtrace) (current-error-port))
|
||||
(display "\n" (current-error-port)))))
|
||||
#:unwind? #t))
|
||||
#:timeout #f)))))
|
||||
(call-with-resource-from-pool (background-connection-pool)
|
||||
(lambda (conn)
|
||||
(with-exception-handler
|
||||
(lambda (exn)
|
||||
(simple-format
|
||||
(current-error-port)
|
||||
"exception in build event handler: ~A\n"
|
||||
exn))
|
||||
(lambda ()
|
||||
(with-throw-handler #t
|
||||
(lambda ()
|
||||
(handler conn))
|
||||
(lambda _
|
||||
(display (backtrace) (current-error-port))
|
||||
(display "\n" (current-error-port)))))
|
||||
#:unwind? #t))
|
||||
#:timeout #f))))
|
||||
|
||||
(define (with-build-ids-for-status data
|
||||
build-ids
|
||||
|
|
|
|||
|
|
@ -814,9 +814,7 @@
|
|||
(('GET "builds")
|
||||
(delegate-to build-controller))
|
||||
(('GET "metrics")
|
||||
(parameterize
|
||||
((resource-pool-default-timeout 6))
|
||||
(render-metrics)))
|
||||
(render-metrics))
|
||||
(('GET "revision" args ...)
|
||||
(delegate-to revision-controller))
|
||||
(('GET "repositories")
|
||||
|
|
|
|||
|
|
@ -210,9 +210,8 @@ port. Also, the port used can be changed by passing the --port option.\n"
|
|||
#:destructor
|
||||
(lambda (conn)
|
||||
(close-postgresql-connection conn "web-reserved"))
|
||||
#:scheduler priority-scheduler))
|
||||
|
||||
(resource-pool-default-timeout 6))
|
||||
#:default-checkout-timeout 6
|
||||
#:scheduler priority-scheduler)))
|
||||
|
||||
(let ((resource-pool-checkout-failures-metric
|
||||
(make-counter-metric registry
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue