diff options
author | Nick White <git@njw.name> | 2022-01-31 14:11:21 +0000 |
---|---|---|
committer | Nick White <git@njw.name> | 2022-01-31 14:11:21 +0000 |
commit | 550752fa2ab493fb6d10aa9d963fc45996c0d100 (patch) | |
tree | 279d2c7c7d062f6232f363d1462539738b7e4cc8 /cmd/booktopipeline | |
parent | 57a3dc6da88e08951060e2e6e11605eb807f54ac (diff) |
Make pipeline context-aware, so the rescribe tool can cancel jobs
Diffstat (limited to 'cmd/booktopipeline')
-rw-r--r-- | cmd/booktopipeline/main.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cmd/booktopipeline/main.go b/cmd/booktopipeline/main.go index b4f4d99..bf088a0 100644 --- a/cmd/booktopipeline/main.go +++ b/cmd/booktopipeline/main.go @@ -7,6 +7,7 @@ package main import ( + "context" "flag" "fmt" "log" @@ -65,6 +66,8 @@ func main() { bookname = filepath.Base(bookdir) } + var ctx context.Context + if *verbose { verboselog = log.New(os.Stdout, "", log.LstdFlags) } else { @@ -97,7 +100,7 @@ func main() { } verboselog.Println("Checking that all images are valid in", bookdir) - err = pipeline.CheckImages(bookdir) + err = pipeline.CheckImages(ctx, bookdir) if err != nil { log.Fatalln(err) } @@ -112,7 +115,7 @@ func main() { } verboselog.Println("Uploading all images are valid in", bookdir) - err = pipeline.UploadImages(bookdir, bookname, conn) + err = pipeline.UploadImages(ctx, bookdir, bookname, conn) if err != nil { log.Fatalln(err) } |