simonsobs / librarian

The HERA Librarian.
BSD 2-Clause "Simplified" License
1 stars 3 forks source link

Remove global session object #24

Closed JBorrow closed 9 months ago

JBorrow commented 9 months ago

Fixes simonsobs/librarian#12

JBorrow commented 9 months ago

Throughout the codebase this now uses the pattern:

from librarian_server.database import get_session

with get_session() as session:
  session.do_stuff()

Rather than using one global session object.