Commit 5cc6897c authored by 高雅喆's avatar 高雅喆

工厂模式,清楚用户ctr 的lin信息

parent dcd18011
......@@ -806,11 +806,11 @@ def clear_history(device_id=None, user_id=-1):
msg = list()
redis_key_list = list()
if device_id:
redis_key_list.extend(('physical:linucb:device_id:%s', 'physical:home_recommend:device_id:%s:query_type:1',
'physical:linucb:tag_recommend:device_id:%s',
'physical:linucb:topic_recommend:device_id:%s',
'physical:linucb:pictorial_recommend:device_id:%s',
'physical:home_pictorial_recommend:device_id:%s:query_type:1'))
redis_key_list.extend(('physical:linucb:device_id:%s', 'ctr_physical:linucb:device_id:%s',
'physical:linucb:tag_recommend:device_id:%s', 'ctr_physical:linucb:tag_recommend:device_id:%s',
'physical:linucb:topic_recommend:device_id:%s', 'ctr_physical:linucb:topic_recommend:device_id:%s',
'physical:linucb:pictorial_recommend:device_id:%s', 'ctr_physical:linucb:pictorial_recommend:device_id:%s',
'physical:home_recommend:device_id:%s:query_type:1', 'physical:home_pictorial_recommend:device_id:%s:query_type:1'))
for redis_key in redis_key_list:
key = redis_key % device_id
if redis_client.type(key) != "b'none'":
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment