We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b1f4700 commit 6e1aa1cCopy full SHA for 6e1aa1c
1 file changed
src/runners/quota_scheduler.py
@@ -95,6 +95,11 @@ def quota_scheduler(config: QuotaHandlersConfiguration) -> bool:
95
for limiter in config.limiters:
96
try:
97
if not connected(connection):
98
+ # the old connection might be closed to avoid resource leaks
99
+ try:
100
+ connection.close()
101
+ except Exception: # pylint: disable=broad-exception-caught
102
+ pass # Connection already dead
103
connection = connect(config)
104
if connection is None:
105
logger.warning("Can not connect to database, skipping")
0 commit comments