def zsite_rank_update(days): n = kv_int.get(KV_ZSITE_RANK_POWER) or 100 for i in ormiter(ZsiteUvDaily, 'days=%s' % days): zsite_id = i.zsite_id zsite_rank_update_by_zsite_id(zsite_id, i.uv*n) mc_zsite_rank_max.delete('') kv_int.set(KV_ZSITE_RANK_POWER, n*1.1)
def zsite_rank_update(days): n = kv_int.get(KV_ZSITE_RANK_POWER) or 100 for i in ormiter(ZsiteUvDaily, 'days=%s' % days): zsite_id = i.zsite_id zsite_rank_update_by_zsite_id(zsite_id, i.uv * n) mc_zsite_rank_max.delete('') kv_int.set(KV_ZSITE_RANK_POWER, n * 1.1)
def zsite_rank_rebase(): n = kv_int.get(KV_ZSITE_RANK_POWER) or 100 if n > 5000: kv_int.set(KV_ZSITE_RANK_POWER, 100) ZsiteRank.raw_sql('update zsite_rank set value=value*100/%s', n) for i in ormiter(ZsiteRank): zsite_rank.mc_flush(i.id) mc_zsite_rank_max.delete('')