|
@@ -453,9 +453,9 @@ class CronDelDataView(View):
|
|
|
nowTime = int(time.time())
|
|
|
try:
|
|
|
cursor = connection.cursor()
|
|
|
- month_ago_time = nowTime - 30 * 24 * 60 * 60 # 保留近30天的数据
|
|
|
+ expired_time = nowTime - 7 * 24 * 60 * 60 # 保留近7天的数据
|
|
|
|
|
|
- sql = 'DELETE FROM `device_log` WHERE unix_timestamp(add_time)<{}'.format(month_ago_time)
|
|
|
+ sql = 'DELETE FROM `device_log` WHERE unix_timestamp(add_time)<{}'.format(expired_time)
|
|
|
cursor.execute(sql)
|
|
|
cursor.close()
|
|
|
return response.json(0)
|