feat: 添加视频举报状态更新功能并调整批次处理逻辑
This commit is contained in:
parent
5f45c5d079
commit
b0745aa420
16
DB.py
16
DB.py
@ -309,7 +309,6 @@ class DBVidcon:
|
|||||||
self.redis.lpush(self.l2_list_key, *raws)
|
self.redis.lpush(self.l2_list_key, *raws)
|
||||||
logger.info(f"[回滚l2] 已退回 {len(raws)} 条")
|
logger.info(f"[回滚l2] 已退回 {len(raws)} 条")
|
||||||
|
|
||||||
|
|
||||||
@mysql_retry()
|
@mysql_retry()
|
||||||
def get_report_video(self):
|
def get_report_video(self):
|
||||||
sql = """
|
sql = """
|
||||||
@ -341,10 +340,17 @@ class DBVidcon:
|
|||||||
now_ts = int(time.time())
|
now_ts = int(time.time())
|
||||||
self.cursor.execute(sql, (new_status, errinfo, now_ts, record_id))
|
self.cursor.execute(sql, (new_status, errinfo, now_ts, record_id))
|
||||||
|
|
||||||
|
@mysql_retry()
|
||||||
|
def update_video_ts_status(self):
|
||||||
|
sql = """
|
||||||
|
UPDATE sh_dm_video_v2 v
|
||||||
|
JOIN sh_dm_video_author a ON v.u_xid = a.u_xid
|
||||||
|
SET v.ts_status = 3
|
||||||
|
WHERE a.white_status = 1;
|
||||||
|
"""
|
||||||
|
self.cursor.execute(sql)
|
||||||
|
self.flush()
|
||||||
|
logger.info("[更新视频举报状态] 已执行完毕")
|
||||||
|
|
||||||
@mysql_retry()
|
@mysql_retry()
|
||||||
def upsert_video(self, data: dict):
|
def upsert_video(self, data: dict):
|
||||||
|
@ -98,9 +98,9 @@ def fetch_all_data_for_rn(rn: str, batches: list[int]) -> pd.DataFrame:
|
|||||||
|
|
||||||
def export_all():
|
def export_all():
|
||||||
# 指定要处理的批次
|
# 指定要处理的批次
|
||||||
batches = [1747324254, 1747323990]
|
batches = [1748965168, 1749049335]
|
||||||
# 先更新 is_repeat
|
# 先更新 is_repeat
|
||||||
update_is_repeat(batches)
|
# update_is_repeat(batches)
|
||||||
|
|
||||||
rn_list = get_rn_list()
|
rn_list = get_rn_list()
|
||||||
timestamp = datetime.now().strftime("%Y%m%d")
|
timestamp = datetime.now().strftime("%Y%m%d")
|
||||||
|
10
update_video_tsstatus.py
Normal file
10
update_video_tsstatus.py
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
from DB import DBVidcon
|
||||||
|
from logger import logger
|
||||||
|
|
||||||
|
|
||||||
|
db = DBVidcon()
|
||||||
|
|
||||||
|
logger.info("开始更新视频举报状态")
|
||||||
|
db.update_video_ts_status()
|
||||||
|
db.close()
|
||||||
|
logger.info("更改视频举报状态完成")
|
Loading…
x
Reference in New Issue
Block a user