fix subreddit watcher

This commit is contained in:
Andre Medeiros 2022-10-31 15:12:27 -04:00
parent a467b08878
commit fbd3ff617a

View file

@ -265,8 +265,7 @@ func (sc *subredditsConsumer) Consume(delivery rmq.Delivery) {
i := rand.Intn(len(watchers)) i := rand.Intn(len(watchers))
watcher := watchers[i] watcher := watchers[i]
acc, _ := sc.accountRepo.GetByID(ctx, watcher.AccountID) rac := sc.reddit.NewAuthenticatedClient(watcher.Account.AccountID, watcher.Account.RefreshToken, watcher.Account.AccessToken)
rac := sc.reddit.NewAuthenticatedClient(acc.AccountID, acc.RefreshToken, acc.AccessToken)
sps, err := rac.SubredditHot(ctx, sps, err := rac.SubredditHot(ctx,
subreddit.Name, subreddit.Name,
reddit.WithQuery("limit", "100"), reddit.WithQuery("limit", "100"),