79447846

Date: 2025-02-18 10:16:16
Score: 0.5
Natty:
Report link

close_old_connections() doesn't work, because for async all the objects will live in different thread. And probably I was calling it differently, when connect in sync_to_async wasn't working. So in the end this works:

await sync_to_async(reconnect)()

with this function:

def reconnect():
    conn=connections['default']
    conn.connect()
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: aikipooh