提交 57c3715d authored 作者: zw.wang's avatar zw.wang

fix: [tasks] 修复删除无视频文件的数据

上级 2b6c18dc
......@@ -3,6 +3,8 @@ from contextlib import contextmanager
from functools import wraps
import mysql.connector
from datetime import timedelta
from dynaconf import settings
from intelab_python_sdk.logger import log
from mysql.connector import errorcode
......@@ -218,8 +220,8 @@ def get_expirted_video_info(cursor, conn, db_table, expired_time):
device_code, start_time, end_time,
'{0}' as db_table
from {0}
where expired_time < "{1}"
'''.format(db_table, expired_time)
where (expired_time is null and start_time < "{1}") or expired_time < "{2}"
'''.format(db_table, expired_time - timedelta(days=30), expired_time)
cursor.execute(sql)
return cursor.fetchall()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论