From ad62000372ea76fdda53b08ae9fa4d12dedca718 Mon Sep 17 00:00:00 2001 From: Andre Medeiros Date: Sat, 25 Jun 2022 15:52:47 -0400 Subject: [PATCH] fix authenticated client call --- internal/worker/subreddits.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/worker/subreddits.go b/internal/worker/subreddits.go index f462c2c..ae0f18d 100644 --- a/internal/worker/subreddits.go +++ b/internal/worker/subreddits.go @@ -195,8 +195,7 @@ func (sc *subredditsConsumer) Consume(delivery rmq.Delivery) { i := rand.Intn(len(watchers)) watcher := watchers[i] - acc, _ := sc.accountRepo.GetByID(sc, watcher.AccountID) - rac := sc.reddit.NewAuthenticatedClient(acc.AccountID, acc.RefreshToken, acc.AccessToken) + rac := sc.reddit.NewAuthenticatedClient(watcher.Account.AccountID, watcher.Account.RefreshToken, watcher.Account.AccessToken) sps, err := rac.SubredditNew(sc, subreddit.Name, reddit.WithQuery("before", before),