summaryrefslogtreecommitdiff
path: root/bookpipeline/cmd/bookpipeline/main.go
diff options
context:
space:
mode:
authorNick White <git@njw.name>2019-09-06 15:49:01 +0100
committerNick White <git@njw.name>2019-09-06 15:49:01 +0100
commitcde53a94fd0eeb65209e549d3e13486dd2681b7e (patch)
tree15c035ea156466272c0e0e17f539f1e1c5dfbe7a /bookpipeline/cmd/bookpipeline/main.go
parent561d8461cbe19316762489cd7b04f95b9014bcda (diff)
Add flags to disable checking various queues
Diffstat (limited to 'bookpipeline/cmd/bookpipeline/main.go')
-rw-r--r--bookpipeline/cmd/bookpipeline/main.go18
1 files changed, 14 insertions, 4 deletions
diff --git a/bookpipeline/cmd/bookpipeline/main.go b/bookpipeline/cmd/bookpipeline/main.go
index ec6a08d..7ffacf8 100644
--- a/bookpipeline/cmd/bookpipeline/main.go
+++ b/bookpipeline/cmd/bookpipeline/main.go
@@ -19,7 +19,7 @@ import (
"rescribe.xyz/go.git/preproc"
)
-const usage = `Usage: bookpipeline [-v] [-t training]
+const usage = `Usage: bookpipeline [-v] [-np] [-no] [-na] [-t training]
Watches the preprocess, ocr and analyse queues for book names. When
one is found this general process is followed:
@@ -325,6 +325,10 @@ func processBook(msg bookpipeline.Qmsg, conn Pipeliner, process func(chan string
func main() {
verbose := flag.Bool("v", false, "verbose")
training := flag.String("t", "rescribealphav5", "tesseract training file to use")
+ nopreproc := flag.Bool("np", false, "disable preprocessing")
+ noocr := flag.Bool("no", false, "disable ocr")
+ noanalyse := flag.Bool("na", false, "disable analysis")
+
flag.Usage = func() {
fmt.Fprintf(flag.CommandLine.Output(), usage)
flag.PrintDefaults()
@@ -356,9 +360,15 @@ func main() {
var checkPreQueue <-chan time.Time
var checkOCRQueue <-chan time.Time
var checkAnalyseQueue <-chan time.Time
- checkPreQueue = time.After(0)
- checkOCRQueue = time.After(0)
- checkAnalyseQueue = time.After(0)
+ if !*nopreproc {
+ checkPreQueue = time.After(0)
+ }
+ if !*noocr {
+ checkOCRQueue = time.After(0)
+ }
+ if !*noanalyse {
+ checkAnalyseQueue = time.After(0)
+ }
for {
select {