|
@@ -40,7 +40,7 @@ from Ansjer.config import OSS_STS_ACCESS_KEY, OSS_STS_ACCESS_SECRET, OSS_ROLE_AR
|
|
|
from Controller.CheckUserData import DataValid
|
|
|
from Model.models import Device_Info, Order_Model, Store_Meal, VodHlsModel, OssCrdModel, UID_Bucket, StsCrdModel, \
|
|
|
ExperienceContextModel, Pay_Type, CDKcontextModel, Device_User, SysMassModel, SysMsgModel, UidPushModel, \
|
|
|
- Unused_Uid_Meal, UIDMainUser, UserModel, PromotionRuleModel, VideoPlaybackTimeModel
|
|
|
+ Unused_Uid_Meal, UIDMainUser, UserModel, PromotionRuleModel, VideoPlaybackTimeModel, CloudLogModel
|
|
|
from Object.AWS.S3Email import S3Email
|
|
|
from Object.AliPayObject import AliPayObject
|
|
|
from Object.AliSmsObject import AliSmsObject
|
|
@@ -1940,4 +1940,14 @@ def updateUnusedUidBucket(request):
|
|
|
except Exception:
|
|
|
continue
|
|
|
# UID_Bucket.objects.filter(id__in=list(id_list)).update(use_status=2) # 更新过期云存关联套餐状态
|
|
|
- return response.json(0)
|
|
|
+ return response.json(0)
|
|
|
+
|
|
|
+# 删除三个月之前的cloud_log数据
|
|
|
+def deleteCloudLog(request):
|
|
|
+ response = ResponseObject()
|
|
|
+ delTime = int(time.time()) - 3 * 30 * 24 * 60 * 60 # 保留3个月的数据
|
|
|
+ for i in range(5):
|
|
|
+ cloud_log_qs = CloudLogModel.objects.filter(time__lte=delTime)[0:10000]
|
|
|
+ id_list = cloud_log_qs.values_list('id', flat=True)
|
|
|
+ CloudLogModel.objects.filter(id__in=list(id_list)).delete()
|
|
|
+ return response.json(0)
|