From cde53a94fd0eeb65209e549d3e13486dd2681b7e Mon Sep 17 00:00:00 2001 From: Nick White Date: Fri, 6 Sep 2019 15:49:01 +0100 Subject: Add flags to disable checking various queues --- bookpipeline/cmd/bookpipeline/main.go | 18 ++++++++++++++---- 1 file 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 { -- cgit v1.2.1-24-ge1ad