mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-10 07:47:53 +00:00
Read database connection parameters from environment
This commit is contained in:
parent
3d2d6b0ea6
commit
780bc8a512
4 changed files with 17 additions and 4 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import asyncio
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
import time
|
||||
from datetime import datetime
|
||||
|
||||
|
|
@ -111,7 +112,13 @@ class PluralKitBot:
|
|||
async def run(self):
|
||||
try:
|
||||
self.logger.info("Connecting to database...")
|
||||
self.pool = await db.connect()
|
||||
self.pool = await db.connect(
|
||||
os.environ["DATABASE_USER"],
|
||||
os.environ["DATABASE_PASS"],
|
||||
os.environ["DATABASE_NAME"],
|
||||
os.environ["DATABASE_HOST"],
|
||||
int(os.environ["DATABASE_PORT"])
|
||||
)
|
||||
|
||||
self.logger.info("Attempting to create tables...")
|
||||
async with self.pool.acquire() as conn:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue