diff options
author | 2021-09-07 18:58:33 +0100 | |
---|---|---|
committer | 2021-09-07 19:01:12 +0100 | |
commit | f12d4ac1a6833a9764035ef32c841ee5d12e066b (patch) | |
tree | a0945231ecb809f5a564a401c2fba0447433cf8d /manage.py | |
parent | Merge pull request #583 from python-discord/init-metricity-at-runtime (diff) |
Remove explicit check for db port, as it's optional
We also do not specifiy it in prod, so this crash looped when trying to deploy
Diffstat (limited to 'manage.py')
-rwxr-xr-x | manage.py | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -60,7 +60,6 @@ class SiteManager: db_url_parts = urlsplit(db_url) if not all(( db_url_parts.hostname, - db_url_parts.port, db_url_parts.username, db_url_parts.password, db_url_parts.path @@ -107,7 +106,8 @@ class SiteManager: # Get database URL based on environmental variable passed in compose database_url_parts = SiteManager.parse_db_url(os.environ["DATABASE_URL"]) domain = database_url_parts.hostname - port = database_url_parts.port + # Port may be omitted, 5432 is the default psql port + port = database_url_parts.port or 5432 # Attempt to connect to the database socket s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |