diff options
author | Nick White <git@njw.name> | 2020-05-26 16:03:17 +0100 |
---|---|---|
committer | Nick White <git@njw.name> | 2020-05-26 16:03:17 +0100 |
commit | 870fb0f3e01a0771d3839da2461e0cec30282bc0 (patch) | |
tree | c8f461ba1b829ce4d91d6eb90fd7d34f1e086845 /cmd/bookpipeline/main.go | |
parent | 3d2bdd1d30ec6d43b4921d29d5a8338d65c48a5a (diff) | |
parent | ebc27eef77868fa44daed7cfb0ea129690029da8 (diff) |
Merge branch 'local'
Diffstat (limited to 'cmd/bookpipeline/main.go')
-rw-r--r-- | cmd/bookpipeline/main.go | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/cmd/bookpipeline/main.go b/cmd/bookpipeline/main.go index 9618e93..344006a 100644 --- a/cmd/bookpipeline/main.go +++ b/cmd/bookpipeline/main.go @@ -25,7 +25,7 @@ import ( "rescribe.xyz/utils/pkg/hocr" ) -const usage = `Usage: bookpipeline [-v] [-np] [-nw] [-nop] [-na] [-t training] [-shutdown true/false] +const usage = `Usage: bookpipeline [-v] [-c conn] [-np] [-nw] [-nop] [-na] [-t training] [-shutdown true/false] Watches the preprocess, wipeonly, ocrpage and analyse queues for messages. When one is found this general process is followed: @@ -677,6 +677,7 @@ func main() { noocrpg := flag.Bool("nop", false, "disable ocr on individual pages") noanalyse := flag.Bool("na", false, "disable analysis") autoshutdown := flag.Bool("shutdown", false, "automatically shut down if no work has been available for 5 minutes") + conntype := flag.String("c", "aws", "connection type ('aws' or 'local')") flag.Usage = func() { fmt.Fprintf(flag.CommandLine.Output(), usage) @@ -697,7 +698,14 @@ func main() { ocredPattern := regexp.MustCompile(`.hocr$`) var conn Pipeliner - conn = &bookpipeline.AwsConn{Region: "eu-west-2", Logger: verboselog} + switch *conntype { + case "aws": + conn = &bookpipeline.AwsConn{Region: "eu-west-2", Logger: verboselog} + case "local": + conn = &bookpipeline.LocalConn{Logger: verboselog} + default: + log.Fatalln("Unknown connection type") + } conn.Log("Setting up AWS session") err := conn.Init() |