|
@@ -36,12 +36,14 @@ class PublishVideosForAudit(object):
|
|
"""
|
|
"""
|
|
already_published_count = self.get_published_articles_today()
|
|
already_published_count = self.get_published_articles_today()
|
|
rest_count = const.MAX_VIDEO_NUM - already_published_count
|
|
rest_count = const.MAX_VIDEO_NUM - already_published_count
|
|
|
|
+
|
|
|
|
+ limit_count = min(rest_count, const.MAX_VIDEO_NUM_PER_PUBLISH)
|
|
sql = f"""
|
|
sql = f"""
|
|
SELECT id, article_title, video_oss_path
|
|
SELECT id, article_title, video_oss_path
|
|
FROM publish_single_video_source
|
|
FROM publish_single_video_source
|
|
WHERE audit_status = {const.VIDEO_AUDIT_INIT_STATUS} and bad_status = {const.TITLE_DEFAULT_STATUS}
|
|
WHERE audit_status = {const.VIDEO_AUDIT_INIT_STATUS} and bad_status = {const.TITLE_DEFAULT_STATUS}
|
|
ORDER BY score DESC
|
|
ORDER BY score DESC
|
|
- LIMIT {rest_count};
|
|
|
|
|
|
+ LIMIT {limit_count};
|
|
"""
|
|
"""
|
|
response = self.db_client.fetch(sql, cursor_type=DictCursor)
|
|
response = self.db_client.fetch(sql, cursor_type=DictCursor)
|
|
return response
|
|
return response
|