mirror of
https://github.com/dimitri/pgloader.git
synced 2026-05-05 02:46:10 +02:00
Make interactive debugging easier.
It's fair game to handle errors and issue logs instead when using the pgloader binary image, as it distracts users a lot. That said, as a developer the interactive debugger is very useful. In passing install some experimental thread killing behavior in case of errors and using on-error-stop setting (default for database migrations).
This commit is contained in:
parent
9ce4088b48
commit
e4a4edb276
@ -74,13 +74,17 @@
|
||||
(incf task-count)))
|
||||
|
||||
(lp:task-handler-bind
|
||||
((copy-init-error
|
||||
(#+pgloader-image
|
||||
(copy-init-error
|
||||
#'(lambda (condition)
|
||||
;; everything has been handled already
|
||||
;; stop the other tasks and then transfer the control
|
||||
(log-message :log "COPY INIT ERROR")
|
||||
(lp:kill-tasks :default)
|
||||
(lp:invoke-transfer-error condition)))
|
||||
(on-error-stop
|
||||
#'(lambda (condition)
|
||||
;; everything has been handled already
|
||||
(log-message :log "ON ERROR STOP")
|
||||
(lp:kill-tasks :default)
|
||||
(lp:invoke-transfer-error condition)))
|
||||
#+pgloader-image
|
||||
(error
|
||||
|
||||
@ -147,7 +147,8 @@
|
||||
(*summary-pathname* . ,*summary-pathname*)
|
||||
(*sections* . ',*sections*)))
|
||||
(kernel (lp:make-kernel 1 :bindings bindings))
|
||||
(lparallel:*kernel* kernel))
|
||||
(lparallel:*kernel* kernel)
|
||||
(lparallel:*task-category* :monitor))
|
||||
|
||||
;; make our kernel and channel visible from the outside
|
||||
(setf *monitoring-kernel* kernel
|
||||
@ -155,7 +156,8 @@
|
||||
*monitoring-queue* (lq:make-queue))
|
||||
|
||||
(lp:task-handler-bind
|
||||
((error
|
||||
(#+pgloader-image
|
||||
(error
|
||||
#'(lambda (c)
|
||||
;; we can't log-message a monitor thread error
|
||||
(lp:invoke-transfer-error
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user