Skip dropping the log part sequence if there's a lock
So that the job completes. The sequence can be deleted later.
This commit is contained in:
parent
a0a7d66b1d
commit
4a9d45aa16
1 changed files with 15 additions and 4 deletions
|
|
@ -300,11 +300,22 @@ WHERE job_id = $1")
|
||||||
(list job-id)))))
|
(list job-id)))))
|
||||||
|
|
||||||
(define (drop-log-parts-sequence conn job-id)
|
(define (drop-log-parts-sequence conn job-id)
|
||||||
(exec-query
|
(with-postgresql-transaction
|
||||||
conn
|
conn
|
||||||
(string-append
|
(lambda (conn)
|
||||||
"DROP SEQUENCE IF EXISTS "
|
(exec-query conn
|
||||||
(log-part-sequence-name job-id))))
|
"SET LOCAL lock_timeout = '10s'")
|
||||||
|
(with-exception-handler
|
||||||
|
(lambda (exn)
|
||||||
|
(simple-format (current-error-port)
|
||||||
|
"error when dropping sequence: ~A"
|
||||||
|
exn))
|
||||||
|
(lambda ()
|
||||||
|
(exec-query conn
|
||||||
|
(string-append
|
||||||
|
"DROP SEQUENCE IF EXISTS "
|
||||||
|
(log-part-sequence-name job-id))))
|
||||||
|
#:unwind? #t))))
|
||||||
|
|
||||||
(define (vacuum-log-parts-table conn)
|
(define (vacuum-log-parts-table conn)
|
||||||
(exec-query
|
(exec-query
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue