|
@@ -29,9 +29,7 @@ def get_videos_from_flow_pool(app_type, size=1000):
|
|
request_data = {'appType': app_type, 'batchFlag': batch_flag, 'size': size}
|
|
request_data = {'appType': app_type, 'batchFlag': batch_flag, 'size': size}
|
|
videos = []
|
|
videos = []
|
|
retry = 0
|
|
retry = 0
|
|
- print("zhangbo1")
|
|
|
|
while True:
|
|
while True:
|
|
- print("zhangbo2")
|
|
|
|
print(config_.GET_VIDEOS_FROM_POOL_URL)
|
|
print(config_.GET_VIDEOS_FROM_POOL_URL)
|
|
result = request_post(request_url=config_.GET_VIDEOS_FROM_POOL_URL, request_data=request_data)
|
|
result = request_post(request_url=config_.GET_VIDEOS_FROM_POOL_URL, request_data=request_data)
|
|
if result is None:
|
|
if result is None:
|
|
@@ -293,6 +291,20 @@ def get_data_from_odps(project, sql):
|
|
data_df = None
|
|
data_df = None
|
|
return data_df
|
|
return data_df
|
|
|
|
|
|
|
|
+def print_check_log(s):
|
|
|
|
+ log_.info(s)
|
|
|
|
+ apptype_list = ["0", "4", "5", "21", "3", "6"]
|
|
|
|
+ level_list = ["1", "2", "3", "4"]
|
|
|
|
+ date_cur = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
|
|
|
+ for app in apptype_list:
|
|
|
|
+ for level in level_list:
|
|
|
|
+ key = "flow:pool:level:item:" + app + ":" + level
|
|
|
|
+ result = redis_helper.get_data_from_set(key)
|
|
|
|
+ if not result:
|
|
|
|
+ result = []
|
|
|
|
+ size = len(result)
|
|
|
|
+ log_str = "\t".join([date_cur, app, level, str(size)])
|
|
|
|
+ log_.info(log_str)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
if __name__ == '__main__':
|
|
st_time = time.time()
|
|
st_time = time.time()
|
|
@@ -322,8 +334,10 @@ if __name__ == '__main__':
|
|
|
|
|
|
# 更新剩余分发数
|
|
# 更新剩余分发数
|
|
log_.info(f"video_info_list count = {len(video_info_list)}")
|
|
log_.info(f"video_info_list count = {len(video_info_list)}")
|
|
|
|
+ print_check_log("--------------------前序日志--------------------")
|
|
get_videos_remain_view_count(video_info_list)
|
|
get_videos_remain_view_count(video_info_list)
|
|
log_.info('flow pool predict end...')
|
|
log_.info('flow pool predict end...')
|
|
log_.info(f"expend time = {(time.time() - st_time) * 1000}ms")
|
|
log_.info(f"expend time = {(time.time() - st_time) * 1000}ms")
|
|
|
|
+ print_check_log("--------------------后续日志--------------------")
|
|
|
|
|
|
# python flowpool_data_update_with_level.py 测试环境必须手动执行python 才能有数据
|
|
# python flowpool_data_update_with_level.py 测试环境必须手动执行python 才能有数据
|