Skip to content

Commit

Permalink
feat: Report database errors when waiting for database in entrypoint (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewelwell authored Apr 22, 2024
1 parent 98e9cbf commit a66c262
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api/core/management/commands/waitfordb.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ def handle(
cursor.execute("SELECT 1")
logger.info("Successfully connected to the database.")
break
except OperationalError:
except OperationalError as e:
logger.warning("Database not yet ready for connections.")
logger.warning("Error was: %s: %s", e.__class__.__name__, e)

time.sleep(wait_between_checks)

Expand Down

0 comments on commit a66c262

Please sign in to comment.