Close db after 5 min idle time
This commit is contained in:
parent
0ab2630519
commit
f4de16fde6
1 changed files with 1 additions and 1 deletions
|
@ -18,7 +18,7 @@ def dbCleanup():
|
|||
time.sleep(60 * 5)
|
||||
for db in opened_dbs[:]:
|
||||
idle = time.time() - db.last_query_time
|
||||
if idle > 60 * 30 and idle < 60 * 60:
|
||||
if idle > 60 * 5 and idle < 60 * 20:
|
||||
db.close()
|
||||
|
||||
gevent.spawn(dbCleanup)
|
||||
|
|
Loading…
Reference in a new issue