Skip to content

Commit 0f5d99c

Browse files
committed
Merge remote-tracking branch 'origin/development' into development
2 parents b2f5b6f + 918d73f commit 0f5d99c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

core/data/impl/nodeimpl.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
LOGIN_URL = 'https://api.digitalcombatsimulator.com/gameapi/login/'
6161
LOGOUT_URL = 'https://api.digitalcombatsimulator.com/gameapi/logout/'
6262
UPDATER_URL = 'https://api.digitalcombatsimulator.com/gameapi/updater/branch/{}/'
63-
LICENSES_URL = 'https://api.digitalcombatsimulator.com/checklicenses.php'
63+
LICENSES_URL = 'https://www.digitalcombatsimulator.com/checklicenses.php'
6464

6565
# Internationalisation
6666
_ = get_translation('core')
@@ -247,15 +247,15 @@ async def init_db(self) -> tuple[ConnectionPool, AsyncConnectionPool]:
247247
pass
248248
# quick connection check
249249
max_attempts = self.config.get("database", self.locals.get('database')).get('max_retries', 10)
250-
for attempt in range(max_attempts):
250+
for attempt in range(max_attempts + 1):
251251
try:
252-
aconn = await psycopg.AsyncConnection.connect(url)
252+
aconn = await psycopg.AsyncConnection.connect(url, connect_timeout=5)
253253
async with aconn:
254254
cursor = await aconn.execute("SHOW server_version")
255255
version = (await cursor.fetchone())[0]
256256
self.log.info(f"- Connection to PostgreSQL {version} established.")
257257
break
258-
except OperationalError:
258+
except ConnectionTimeout:
259259
if attempt == max_attempts:
260260
raise
261261
self.log.warning("- Database not available, trying again in 5s ...")

0 commit comments

Comments
 (0)