Added port argument

This commit is contained in:
Frisk 2021-03-20 14:44:29 +01:00
parent 7492229eb2
commit 0af390d80f
No known key found for this signature in database
GPG key ID: 213F7C15068AF8AC
2 changed files with 3 additions and 1 deletions

View file

@ -12,6 +12,7 @@
"pg_host": "localhost", "pg_host": "localhost",
"pg_db": "rcgcdb", "pg_db": "rcgcdb",
"pg_pass": "secret_password", "pg_pass": "secret_password",
"pg_port": "5432",
"irc_servers": { "irc_servers": {
"your custom name for the farm": { "your custom name for the farm": {
"domains": ["wikipedia.org", "otherwikipedia.org"], "domains": ["wikipedia.org", "otherwikipedia.org"],

View file

@ -15,7 +15,8 @@ class db_connection:
# as a "postgres" user. # as a "postgres" user.
logger.debug("Setting up the Database connection...") logger.debug("Setting up the Database connection...")
self.connection = await asyncpg.create_pool(user=settings["pg_user"], host=settings.get("pg_host", "localhost"), 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)) logger.debug("Database connection established! Connection: {}".format(self.connection))
async def shutdown_connection(self): async def shutdown_connection(self):