mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-04 17:01:09 +00:00
perf: 优化 celery 任务中的数据库连接问题
perf: add comment
This commit is contained in:
@@ -44,6 +44,7 @@ def get_objects(model, pks):
|
||||
return objs
|
||||
|
||||
|
||||
# 复制 django.db.close_old_connections, 因为它没有导出,ide 提示有问题
|
||||
def close_old_connections():
|
||||
for conn in connections.all():
|
||||
conn.close_if_unusable_or_obsolete()
|
||||
|
Reference in New Issue
Block a user