1
0
mirror of https://github.com/ilri/dspace-statistics-api.git synced 2024-11-22 14:25:01 +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
..
docs Sync API documentation HTML with README.md 2018-11-01 00:37:52 +02:00
__init__.py Refactor project structure 2018-10-28 11:14:21 +02:00
app.py Refactor database code to use a context manager 2018-11-07 17:41:21 +02:00
config.py Allow configuration of PostgreSQL port 2018-11-03 22:40:45 +02:00
database.py Refactor database code to use a context manager 2018-11-07 17:41:21 +02:00
indexer.py Refactor database code to use a context manager 2018-11-07 17:41:21 +02:00
solr.py Correct issues highlighted by Flake8 2018-11-04 00:04:27 +02:00