I set up a postgresql server using Heroku in addition to my python bot which also runs on heroku but the bot fails to connect to the database
I secured that the password username etc. where correct.
This is the method used to connect:
async def create_db_pool():
bot.pg_con = await asyncpg.create_pool(database="dbname",
user="username",
password="dbpw")
And this is how i run it:
bot.loop.run_until_complete(create_db_pool())
It is expected to access the database and write and read data instead i receive following error:
asyncpg.exceptions.ConnectionDoesNotExistError: connection was closed in the middle of operation
Task was destroyed but it is pending!
task: <Task pending coro=<chng_pr() running at I:/Python/HardCoreDisBot/Commands.py:38> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x000002571E9B1978>()]>>