mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-11 08:10:10 +00:00
Add support for a configuration file.
This commit is contained in:
parent
6794f0ab03
commit
f21fd968fd
9 changed files with 51 additions and 82 deletions
|
|
@ -12,10 +12,10 @@ from pluralkit.system import System
|
|||
from pluralkit.member import Member
|
||||
|
||||
logger = logging.getLogger("pluralkit.db")
|
||||
async def connect(username, password, database, host, port):
|
||||
async def connect(uri):
|
||||
while True:
|
||||
try:
|
||||
return await asyncpg.create_pool(user=username, password=password, database=database, host=host, port=port)
|
||||
return await asyncpg.create_pool(uri)
|
||||
except (ConnectionError, asyncpg.exceptions.CannotConnectNowError):
|
||||
logger.exception("Failed to connect to database, retrying in 5 seconds...")
|
||||
time.sleep(5)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue