Truncate promotion_history to most recent 31 days.

This commit is contained in:
bsimpson63
2012-11-15 18:49:07 -05:00
committed by Neil Williams
parent 157362fa6b
commit f0ccf5ae27

View File

@@ -399,6 +399,9 @@ class PromotedLinkTraffic(RedditTraffic):
self.history = []
return
cutoff = end - datetime.timedelta(days=31)
start = max(start, cutoff)
fullname = self.thing._fullname
imps = traffic.AdImpressionsByCodename.promotion_history(fullname,
start, end)