Always close db after 5 min idle time

This commit is contained in:
shortcutme 2016-09-07 17:40:35 +02:00
parent a6c4a77e13
commit 75e74f1ff7
1 changed files with 1 additions and 1 deletions

View File

@ -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 * 5 and idle < 60 * 20:
if idle > 60 * 5:
db.close()
gevent.spawn(dbCleanup)