liqian 3 năm trước cách đây
mục cha
commit
99243a6eaa
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  1. 3 0
      videos_filter.py

+ 3 - 0
videos_filter.py

@@ -61,6 +61,9 @@ def filter_relevant_videos():
         # 以最晚结束的视频的结束时间 - 当前时间 + 5s 作为key的过期时间
         finish_time_list = [item['finish_time'] for item in relevant_videos_new]
         expire_time = max(finish_time_list) - int(time.time()) + 5
+        if expire_time <= 0:
+            log_.info('head_vid = {} expire_time <= 0!'.format(head_vid))
+            continue
         # 存入redis
         redis_helper.set_data_to_redis(key_name=key_name,
                                        value=json.dumps(relevant_videos_new),