mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
chore: Add cooldown for database connection tests on the scheduler
This commit is contained in:
parent
ed0283737d
commit
1627d5ba33
1 changed files with 3 additions and 0 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
from contextlib import suppress
|
||||
from copy import deepcopy
|
||||
from datetime import datetime
|
||||
from functools import partial
|
||||
from glob import glob
|
||||
from json import loads
|
||||
|
|
@ -363,6 +364,8 @@ class JobScheduler(ApiCaller):
|
|||
except BaseException:
|
||||
self.db.readonly = True
|
||||
return True
|
||||
elif self.db.last_connection_retry and (datetime.now() - self.db.last_connection_retry).total_seconds() > 30:
|
||||
return True
|
||||
|
||||
if self.db.database_uri and self.db.readonly:
|
||||
try:
|
||||
|
|
|
|||
Loading…
Reference in a new issue