Skip to content

Fix Close Private Repo Connection on Error#18

Merged
hayesZach merged 5 commits intomasterfrom
fix/private-repo-close-conn
Jan 16, 2026
Merged

Fix Close Private Repo Connection on Error#18
hayesZach merged 5 commits intomasterfrom
fix/private-repo-close-conn

Conversation

@hayesZach
Copy link
Copy Markdown
Collaborator

@hayesZach hayesZach commented Jan 14, 2026

Closes the private repository connection on initialization error. Also adds function to manually close the connection.


Note

Improves lifecycle management of the private DB repository and wires the key repo.

  • Adds Close() to PrivateRepository and implements graceful DB shutdown in private/private.go
  • Cleans up on initialization errors: on any init failure, closes the DB, marks repository as closed, and returns the joined error
  • Prevents reuse after close: guards access with RW mutex and returns an error if the repository is already closed
  • Implements Key() to return NewKeyRepository (was previously a stub)
  • Minor refactors: shared init error handling, added imports, and state (closed, err)

Written by Cursor Bugbot for commit f537e0a. This will update automatically on new commits. Configure here.

@hayesZach hayesZach self-assigned this Jan 14, 2026
@hayesZach hayesZach added the bug Something isn't working label Jan 14, 2026
@hayesZach hayesZach marked this pull request as ready for review January 14, 2026 22:12
@hayesZach hayesZach requested a review from Step7750 January 14, 2026 22:27
@hayesZach hayesZach merged commit 4607cc8 into master Jan 16, 2026
2 checks passed
@hayesZach hayesZach deleted the fix/private-repo-close-conn branch January 16, 2026 01:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants