lorenzo-frittoli / forme-website

Website used for Cassini highschool 2023 ForMe festival
Eclipse Public License 2.0
2 stars 1 forks source link

Manage database connections and cursors and session data #32

Closed BestCrazyNoob closed 4 months ago

BestCrazyNoob commented 4 months ago

We could consider opening the cursor in before_request and closing it in after_request. It might be better to include the opening of connections and cursors in a decorator and to use that decorator only on functions that actually read the database (not all do, for example /index does not). It also looks like at the moment we are querying the database for no reason in before_request because the data is already stored in the session from the login.