From fbd3ff617aa31fce483efd1e20439cb923c1ef03 Mon Sep 17 00:00:00 2001 From: Andre Medeiros Date: Mon, 31 Oct 2022 15:12:27 -0400 Subject: [PATCH] fix subreddit watcher --- 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 e87e315..62e367c 100644 --- a/internal/worker/subreddits.go +++ b/internal/worker/subreddits.go @@ -265,8 +265,7 @@ func (sc *subredditsConsumer) Consume(delivery rmq.Delivery) { i := rand.Intn(len(watchers)) watcher := watchers[i] - acc, _ := sc.accountRepo.GetByID(ctx, 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.SubredditHot(ctx, subreddit.Name, reddit.WithQuery("limit", "100"),