I implemented chat using a long survey of ajax and Gevent. To read, the ajax client displays the update view and waits for Gevent.event.wait to update.
Problem: The Postgresql operation opened by Django at the beginning of the request (to obtain session information) does not close until the end of the request. And these unoccupied transactions take up a lot of memory.
What would be the cleanest way to close a Postgresql transaction without closing the request? I am currently sending request_finished manually, but this seems like a hack.
Ashe
source share