소스 검색

关闭数据库连接

locky 1 년 전
부모
커밋
1b8a0ec1cf
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      Controller/Cron/CronTaskController.py

+ 2 - 0
Controller/Cron/CronTaskController.py

@@ -3,6 +3,7 @@
 # @Time      : 2023/12/11 15:47
 import threading
 
+from django.db import close_old_connections
 from django.views import View
 
 from Object.RedisObject import RedisObject
@@ -64,3 +65,4 @@ class CronTaskView(View):
                     encode('UTF-8', 'ignore').decode('UTF-8')
             equipment_info_list.append(equipment_info_model(**equipment_info_data))
         equipment_info_model.objects.bulk_create(equipment_info_list)
+        close_old_connections()