mirror of
https://github.com/dimitri/pgloader.git
synced 2025-08-08 15:27:00 +02:00
Be more verbose with long-running loads.
Add a message every 20 batches so that the user knows it's still going on. Also, in passing, fix some messages: present is not precise enough to decide if the log refers to an event that is being done or starting next.
This commit is contained in:
parent
28db6b9f13
commit
c62f4279c0
@ -207,6 +207,7 @@
|
||||
|
||||
#:pgtable-initialize-reject-files
|
||||
#:pgtable-secs
|
||||
#:pgtable-rows
|
||||
#:pgtable-start
|
||||
#:pgtable-stop
|
||||
#:pgtable-reject-data
|
||||
|
@ -135,7 +135,7 @@
|
||||
;; able to benefit from the indexes. In particular avoid doing that step
|
||||
;; while CREATE INDEX statements are in flight (avoid locking).
|
||||
;;
|
||||
(log-message :notice "Complete PostgreSQL database.")
|
||||
(log-message :notice "Completing PostgreSQL database.")
|
||||
|
||||
(when reset-sequences
|
||||
(reset-sequences (clone-connection (target-db copy)) catalog))
|
||||
|
@ -238,6 +238,21 @@
|
||||
:rs (update-stats-rs event)
|
||||
:ws (update-stats-ws event))
|
||||
|
||||
;; log some kind of a “keep alive” message to the user, for
|
||||
;; the sake of showing progress.
|
||||
;;
|
||||
;; something like one message every 20 batches should only
|
||||
;; target big tables where we have to wait for a pretty long
|
||||
;; time.
|
||||
(when (and (update-stats-rows event)
|
||||
(typep label 'pgloader.catalog:table)
|
||||
(< (* 19 *copy-batch-rows*)
|
||||
(mod (pgtable-rows table)
|
||||
(* 20 *copy-batch-rows*))))
|
||||
(log-message :notice "copy ~a: ~d rows done"
|
||||
(pgloader.catalog:format-table-name label)
|
||||
(pgtable-rows table)))
|
||||
|
||||
(when (update-stats-start event)
|
||||
(log-message :debug "start ~a ~30t ~a"
|
||||
(pgloader.catalog:format-table-name label)
|
||||
|
Loading…
Reference in New Issue
Block a user