Skip to content

fix(sensor): close Cursor SQLite connections - #87

Draft
barisozbas wants to merge 1 commit into
mainfrom
pr/cursor-close-database
Draft

fix(sensor): close Cursor SQLite connections#87
barisozbas wants to merge 1 commit into
mainfrom
pr/cursor-close-database

Conversation

@barisozbas

Copy link
Copy Markdown
Collaborator

What changed

Cursor SQLite connections are now closed deterministically after parsing.

  • Releases the connection on successful reads, empty results, and exceptions.
  • Keeps existing parsing and error handling behavior unchanged.
  • Adds a regression test using a real temporary SQLite database.

Why

Leaked read connections can retain file descriptors and database locks across repeated collection runs.

Validation

  • pytest -q Sensor/tests
  • ruff check Sensor/adr_sensor/parsers/cursor_parser.py Sensor/tests/test_parsers.py

Summary:
Intent:
- Release Cursor database resources reliably after parsing.

Changes:
- Close connections on success and failure paths.
- Verify closure against a real temporary SQLite database.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant