summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick White <git@njw.name>2020-09-15 11:54:36 +0100
committerNick White <git@njw.name>2020-09-15 11:54:36 +0100
commit2d9546fe42c85e9882ff3ec041de75f7048e7d3a (patch)
tree37c255665fc524c2500b66b77b58a4ca61d514d7
parentd1f2d7b47dd4349d91062f3a1cf6c418d476c4ca (diff)
Abort and delete a failed wipeonly job, like we do with preprocessing
There was no reason not to do this with wipeonly as well, and sure enough a single broken PNG image in a wipeonly task would cause the queue to exponentially fill as happened previously.
-rw-r--r--cmd/bookpipeline/main.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd/bookpipeline/main.go b/cmd/bookpipeline/main.go
index a36e7cb..36295a6 100644
--- a/cmd/bookpipeline/main.go
+++ b/cmd/bookpipeline/main.go
@@ -639,11 +639,11 @@ func processBook(msg bookpipeline.Qmsg, conn Pipeliner, process func(chan string
case err = <-errc:
t.Stop()
_ = os.RemoveAll(d)
- // if the error is in preprocessing, chances are that it will never
+ // if the error is in preprocessing / wipeonly, chances are that it will never
// complete, and will fill the ocrpage queue with parts which succeeded
// on each run, so in that case it's better to delete the message from
// the queue and notify us.
- if fromQueue == conn.PreQueueId() {
+ if fromQueue == conn.PreQueueId() || fromQueue == conn.WipeQueueId() {
conn.Log("Deleting message from queue due to a bad error", fromQueue)
err2 := conn.DelFromQueue(fromQueue, msg.Handle)
if err2 != nil {
@@ -660,7 +660,7 @@ func processBook(msg bookpipeline.Qmsg, conn Pipeliner, process func(chan string
logs = ""
}
msg := fmt.Sprintf("To: %s\r\nFrom: %s\r\n" +
- "Subject: [bookpipeline] Error in preprocessing queue with %s\r\n\r\n" +
+ "Subject: [bookpipeline] Error in wipeonly / preprocessing queue with %s\r\n\r\n" +
" Fail message: %s\r\nFull log:\r\n%s\r\n",
ms.to, ms.from, bookname, err, logs)
host := fmt.Sprintf("%s:%s", ms.server, ms.port)