diff --git a/settings.json.example b/settings.json.example index 33f9848..7c57368 100644 --- a/settings.json.example +++ b/settings.json.example @@ -12,6 +12,7 @@ "pg_host": "localhost", "pg_db": "rcgcdb", "pg_pass": "secret_password", + "pg_port": "5432", "irc_servers": { "your custom name for the farm": { "domains": ["wikipedia.org", "otherwikipedia.org"], diff --git a/src/database.py b/src/database.py index 190ec4f..deadb35 100644 --- a/src/database.py +++ b/src/database.py @@ -15,7 +15,8 @@ class db_connection: # as a "postgres" user. logger.debug("Setting up the Database connection...") self.connection = await asyncpg.create_pool(user=settings["pg_user"], host=settings.get("pg_host", "localhost"), - database=settings.get("pg_db", "rcgcdb"), password=settings.get("pg_pass")) + database=settings.get("pg_db", "rcgcdb"), password=settings.get("pg_pass"), + port=settings.get("pg_port", 5432)) logger.debug("Database connection established! Connection: {}".format(self.connection)) async def shutdown_connection(self):