|
@@ -2,6 +2,7 @@ import json
|
|
|
import time
|
|
|
import multiprocessing
|
|
|
import traceback
|
|
|
+import hashlib
|
|
|
|
|
|
from datetime import datetime
|
|
|
|
|
@@ -327,10 +328,8 @@ def video_homepage_recommend(mid, uid, size, app_type, algo_type, client_info):
|
|
|
"""
|
|
|
# 对 vlog 切换10%的流量做实验
|
|
|
# 对mid进行哈希
|
|
|
- print(hash(mid))
|
|
|
- print(abs(hash(mid)) % 10)
|
|
|
- if app_type in config_.AB_TEST['rank_by_h'] and abs(hash(mid)) % 10 in [0, 1, 7, 8, 4, ]:
|
|
|
- print('in')
|
|
|
+ hash_mid = hashlib.md5(mid.encode('utf-8')).hexdigest()
|
|
|
+ if app_type in config_.AB_TEST['rank_by_h'] and hash_mid[-1:] in ['8', '0', 'a', 'b']:
|
|
|
# 简单召回 - 排序 - 兜底
|
|
|
rank_result, last_rov_recall_key = video_recommend(mid=mid, uid=uid, size=size, app_type=app_type,
|
|
|
algo_type=algo_type, client_info=client_info,
|