From 4ec733809064ec1f1caa298915d52ebaa8f759ff Mon Sep 17 00:00:00 2001 From: Andre Medeiros Date: Fri, 16 Dec 2022 13:38:42 -0500 Subject: [PATCH] [render skip] log median score --- internal/worker/trending.go | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/internal/worker/trending.go b/internal/worker/trending.go index 19e3c15..72c515f 100644 --- a/internal/worker/trending.go +++ b/internal/worker/trending.go @@ -196,14 +196,6 @@ func (tc *trendingConsumer) Consume(delivery rmq.Delivery) { zap.Int("count", tps.Count), ) - if tps.Count == 0 { - tc.logger.Debug("no top posts, bailing early", - zap.Int64("subreddit#id", id), - zap.String("subreddit#name", subreddit.NormalizedName()), - ) - return - } - if tps.Count < 20 { tc.logger.Debug("no top posts, bailing early", zap.Int64("subreddit#id", id), @@ -307,6 +299,7 @@ func (tc *trendingConsumer) Consume(delivery rmq.Delivery) { zap.String("subreddit#name", subreddit.NormalizedName()), zap.String("post#id", post.ID), zap.String("apns", watcher.Device.APNSToken), + zap.Int64("median_score", medianScore), ) } else if !res.Sent() { _ = tc.statsd.Incr("apns.notification.errors", []string{}, 1) @@ -315,6 +308,7 @@ func (tc *trendingConsumer) Consume(delivery rmq.Delivery) { zap.String("subreddit#name", subreddit.NormalizedName()), zap.String("post#id", post.ID), zap.String("apns", watcher.Device.APNSToken), + zap.Int64("median_score", medianScore), zap.Int("response#status", res.StatusCode), zap.String("response#reason", res.Reason), ) @@ -326,6 +320,7 @@ func (tc *trendingConsumer) Consume(delivery rmq.Delivery) { zap.String("post#id", post.ID), zap.Int64("post#score", post.Score), zap.String("device#token", watcher.Device.APNSToken), + zap.Int64("median_score", medianScore), ) } }