mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-10 15:57: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
|
|
@ -11,10 +11,10 @@ from discord.utils import snowflake_time
|
|||
from pluralkit import System, Member, stats
|
||||
|
||||
logger = logging.getLogger("pluralkit.db")
|
||||
async def connect():
|
||||
async def connect(username, password, database, host, port):
|
||||
while True:
|
||||
try:
|
||||
return await asyncpg.create_pool(user="postgres", password="postgres", database="postgres", host="db")
|
||||
return await asyncpg.create_pool(user=username, password=password, database=database, host=host, port=port)
|
||||
except (ConnectionError, asyncpg.exceptions.CannotConnectNowError):
|
||||
pass
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue