gnosis / prediction-market-agent-tooling

Tools to benchmark, deploy and monitor prediction market agents.
GNU Lesser General Public License v3.0
21 stars 4 forks source link

Have only one instance of engine connection to Postgres #551

Open kongzii opened 1 week ago

kongzii commented 1 week ago

Currently, we are using create_engine from sqlmodel on many places (just search for create_engine in PMAT and PMA), however, according to docs:

> You should normally have a single engine object for your whole application and re-use it everywhere.

The problem we started to see is that Postgres is erroring out, because too many connections are open.

I did a quick fix here, hopefully it will help, but this issue is still good to be implemented.