Browse Source

定时删除推送数据每次删除5万条

locky 3 years ago
parent
commit
eae45d5d3c
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Controller/EquipmentInfo.py

+ 1 - 1
Controller/EquipmentInfo.py

@@ -297,7 +297,7 @@ def deleteExpireEquipmentInfo(request):
     nowTime = int(time.time())
     cursor = connections['mysql02'].cursor()
     try:
-        for i in range(10):
+        for i in range(5):
             # 删除7天前的数据
             sql = "DELETE FROM `equipment_info` WHERE addTime<={} LIMIT 10000".format(nowTime - 3600 * 24 * 7)
             cursor.execute(sql)