From 7a48bccf3695204f56516d3f13b27889e628a646 Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Thu, 1 Apr 2021 00:29:46 +0000 Subject: [PATCH] twitterchiver/relatedfetcher: wire bucket from flag into worker config --- go/twitterchiver/related_fetcher/fetcher.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/go/twitterchiver/related_fetcher/fetcher.go b/go/twitterchiver/related_fetcher/fetcher.go index d80fd21a64..b05a2778c5 100644 --- a/go/twitterchiver/related_fetcher/fetcher.go +++ b/go/twitterchiver/related_fetcher/fetcher.go @@ -457,6 +457,13 @@ func main() { } defer conn.Close() + bucket, err := blob.OpenBucket(ctx, *mediaFetchDestination) + if err != nil { + fmt.Fprintf(os.Stderr, "Unable to connect to bucket: %v\n", err) + os.Exit(1) + } + defer bucket.Close() + ckey, csecret := os.Getenv("TWITTER_OAUTH_CONSUMER_KEY"), os.Getenv("TWITTER_OAUTH_CONSUMER_SECRET") if ckey == "" || csecret == "" { fmt.Fprintf(os.Stderr, "No TWITTER_OAUTH_CONSUMER_KEY or TWITTER_OAUTH_CONSUMER_SECRET\n") @@ -508,6 +515,7 @@ func main() { DatabasePool: conn, WorkQueue: workQueue, + Bucket: bucket, } configs := map[string]WorkerConfig{ "media": cfg.Merge(WorkerConfig{