locky 4 лет назад
Родитель
Сommit
36ca876bb6
1 измененных файлов с 3 добавлено и 3 удалено
  1. 3 3
      Controller/EquipmentInfo.py

+ 3 - 3
Controller/EquipmentInfo.py

@@ -315,12 +315,12 @@ def deleteExpireEquipmentInfo(request):
     cycles_count = 10
     try:
         for i in range(cycles_count):
-            ei = Equipment_Info.objects.filter(addTime__lte=str(nowTime - 3600 * 24 * 7))[0:5000]
+            ei = Equipment_Info.objects.filter(addTime__lte=str(nowTime - 3600 * 24 * 7))[0:10000]
             id_list = list(ei.values_list("id", flat=True))
             # print(id_list)
             Equipment_Info.objects.filter(id__in=id_list).delete()
-            id_list.clear()
-            time.sleep(2)
+            # id_list.clear()
+            # time.sleep(2)
         return response.json(0)
     except Exception as e:
         return response.json(500, repr(e))