twitterchiver/relatedfetcher: wire bucket from flag into worker config

This commit is contained in:
Luke Granger-Brown 2021-04-01 00:29:46 +00:00
parent bab069b286
commit 7a48bccf36

View file

@ -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{