mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-25 06:48:01 -05:00
Log vislink builder skipped occurrences.
It appears that sometimes vislink is being skipped by the builder, leading to a blank ad box. I discovered this because the interest bar code would raise an exception upon the occurrence. I'd like to log this case to gauge how often this is occurring.
This commit is contained in:
committed by
Neil Williams
parent
4a6d1ab69f
commit
3beee33287
@@ -324,16 +324,19 @@ class HotController(FixListing, ListingController):
|
||||
max_num = self.listing_obj.max_num,
|
||||
max_score = self.listing_obj.max_score).listing()
|
||||
|
||||
has_subscribed = c.user.has_subscribed
|
||||
promo_visible = promote.is_promo(s.lookup[vislink])
|
||||
if not promo_visible:
|
||||
prob = g.live_config['spotlight_interest_sub_p'
|
||||
if has_subscribed else
|
||||
'spotlight_interest_nosub_p']
|
||||
if random.random() < prob:
|
||||
bar = InterestBar(has_subscribed)
|
||||
s.spotlight_items.insert(pos, bar)
|
||||
s.visible_item = bar
|
||||
if vislink not in s.lookup:
|
||||
g.log.error("spotlight vislink skipped by builder: %s" % vislink)
|
||||
else:
|
||||
has_subscribed = c.user.has_subscribed
|
||||
promo_visible = promote.is_promo(s.lookup[vislink])
|
||||
if not promo_visible:
|
||||
prob = g.live_config['spotlight_interest_sub_p'
|
||||
if has_subscribed else
|
||||
'spotlight_interest_nosub_p']
|
||||
if random.random() < prob:
|
||||
bar = InterestBar(has_subscribed)
|
||||
s.spotlight_items.insert(pos, bar)
|
||||
s.visible_item = bar
|
||||
|
||||
if len(s.things) > 0:
|
||||
# only pass through a listing if the links made it
|
||||
|
||||
Reference in New Issue
Block a user