💾 Archived View for thebird.nl › gn-gemtext-threads › issues › sql-too-many-connections.gmi captured on 2022-06-03 at 23:09:23. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2022-04-28)
-=-=-=-=-=-=-
See the strack trace present in this page:
https://ci.genenetwork.org/jobs/genenetwork2/214
The function decorated with `@app.before_requests` is called before every request, even ones retrieving static files like CSS and JS files. This executes the `sqlalchemy.create_engine(...)' statement many times for each page.
I started by checking whether the request is to a *static* or *js* endpoint, and if it is, we do not bother trying to create the engine in that case.
This does not resolve the issue per-se, but it does reduce a lot of the noise when logging.