You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think I'm noticing when I leave the listener on for an extended period of time, it creates multiple connections over time instead of re-using the same connection over and over. It behaves nicely for a bit but at some point, the number of connections skyrockets and it locks up my dev/test database. Was wondering if you should add some checks inside await_pg_notifications to see if the connection is stale/invalid before reconnecting.
The text was updated successfully, but these errors were encountered:
I was originally passing in a connecting string into the await_notifications but changed it to create the connection instance outside of my functions call, and then pass it in. I am now testing this to see if any improvements.
for notification in await_pg_notifications(
"postgres://%s:%s@%s:%s/%s" % (
os.getenv("DB_USERNAME"),
os.getenv("DB_PASSWORD"),
os.getenv("DB_HOST"),
os.getenv("DB_PORT"),
os.getenv("DB_DATABASE")
),
['on_useractivity'],
handle_signals=SIGNALS_TO_HANDLE):
On Apr 3, 2021, at 7:32 PM, djrobstep ***@***.***> wrote:
Thanks for filing this issue!
In the interests of narrowing down the cause, are you able to share a sanitized snippet of the code you're using to create the connection?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#5 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AHDNFB7JRATLHLKSXNKZSKLTG6JQVANCNFSM42IIPMXA>.
I think I'm noticing when I leave the listener on for an extended period of time, it creates multiple connections over time instead of re-using the same connection over and over. It behaves nicely for a bit but at some point, the number of connections skyrockets and it locks up my dev/test database. Was wondering if you should add some checks inside
await_pg_notifications
to see if the connection is stale/invalid before reconnecting.The text was updated successfully, but these errors were encountered: