1
0
mirror of https://github.com/ilri/dspace-statistics-api.git synced 2025-01-24 19:33:25 +01:00
dspace-statistics-api/dspace_statistics_api
Alan Orth 2f342be948
Refactor database code to use a context manager
Instead of opening one global persistent database connection when
the application I am now abstracting it to a class that I can use
in combination with Python's "with" context. Both connections and
cursors are kept for the context of each "with" block and closed
automatically when exiting.

See: https://alysivji.github.io/managing-resources-with-context-managers-pythonic.html
See: http://initd.org/psycopg/docs/connection.html#connection.close
2018-11-07 17:41:21 +02:00
..
2018-10-28 11:14:21 +02:00
2018-11-04 00:04:27 +02:00