Serve ad data from LiveAdWeights, not permacache

This commit is contained in:
Keith Mitchell
2012-11-07 13:48:20 -08:00
parent a0eef4ca5d
commit 9ae5aaa82a
3 changed files with 3 additions and 3 deletions

View File

@@ -215,7 +215,7 @@ def wrap_links(links, wrapper = default_thing_wrapper(),
num = None, show_nums = False, nextprev = False,
num_margin = None, mid_margin = None, **kw):
links = tup(links)
if not all(isinstance(x, str) for x in links):
if not all(isinstance(x, basestring) for x in links):
links = [x._fullname for x in links]
b = IDBuilder(links, num = num, wrap = wrapper, **kw)
l = listing_cls(b, nextprev = nextprev, show_nums = show_nums)

View File

@@ -799,7 +799,7 @@ def get_promotion_list(user, site):
def get_promotions_cached(sites):
p = get_live_promotions(sites, from_permacache=True)
p = get_live_promotions(sites, from_permacache=False)
if p:
links, promo_dict = p
available = {}

View File

@@ -188,7 +188,7 @@ class LiveAdWeights(object):
# Mangling: Caller convention is to use empty string for FRONT_PAGE
sr_ids = [(sr_id or cls.FRONT_PAGE) for sr_id in sr_ids]
adweights = sgm(cls.cache, sr_ids, cls._load_multi,
prefix=cls.cache_prefix)
prefix=cls.cache_prefix, stale=True)
results = {sr_id: cls.from_columns(adweights[sr_id])
for sr_id in adweights}
if cls.FRONT_PAGE in results: