Relative Content

Tag Archive for djangomultithreadingheroku

Heroku DB Connection Limit hit when using Python ThreadPoolExecutor

I have a Django app hosted on Heroku. Some user requests to this app require making long-running queries to external resources. In order to get around the Heroku 30 request timeout, I created a system where these long running queries are given unique IDs and handed to a Python ThreadPoolExecutor so as not to hold off the query. The original query returns immediately and the font end JS code periodically checks in for a results.