metno / catalog-rebuilder

Catalog rebuilder of CSW and Solr for the S-ENDA project
Apache License 2.0
0 stars 0 forks source link

Catalog rebuilder loosing connection wit postgis-operator database. #7

Closed magnarem closed 1 year ago

magnarem commented 1 year ago

Some new problem have arised today, that the catalog-rebuilder is loosing the connection to the postgis-operator postgresql database.

The current implementation is a bit bad, since we only create the database connection once when the flask app is initializing.

A better and recommended design pattern, is to ask for a new connection object every time it is needed, and reconnect then if the conncetion are broken.

magnarem commented 1 year ago

Added function that return new db-connection if connection are closed.

Closing this issue