fix trending

This commit is contained in:
Andre Medeiros 2022-07-04 09:49:30 -04:00
parent fdcb900297
commit f0c93a8bb9

View file

@ -222,7 +222,8 @@ func (tc *trendingConsumer) Consume(delivery rmq.Delivery) {
i = rand.Intn(len(watchers))
watcher = watchers[i]
rac = tc.reddit.NewAuthenticatedClient(watcher.Account.AccountID, watcher.Account.RefreshToken, watcher.Account.AccessToken)
hps, err := tc.reddit.SubredditHot(tc, subreddit.Name, reddit.WithQuery("show", "all"), reddit.WithQuery("always_show_media", "1"))
hps, err := rac.SubredditHot(tc, subreddit.Name, reddit.WithQuery("show", "all"), reddit.WithQuery("always_show_media", "1"))
if err != nil {
tc.logger.Error("failed to fetch hot posts",
zap.Error(err),