Skip to content

Commit

Permalink
Enable pool_pre_ping and pool_reset_on_return (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanfranklin authored Aug 31, 2023
1 parent 0b98e25 commit 53c62f2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion geoapi/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
settings.DB_HOST,
settings.DB_NAME
)
engine = create_engine(CONNECTION_STRING, echo=False)
engine = create_engine(CONNECTION_STRING,
echo=False, # default value
pool_pre_ping=True,
pool_reset_on_return=True)

db_session = scoped_session(sessionmaker(autocommit=False,
autoflush=False,
Expand Down

0 comments on commit 53c62f2

Please sign in to comment.