Skip to content

Add IsClosed method#1475

Merged
jarifibrahim merged 2 commits intomasterfrom
ibrahim/db-closed
Aug 26, 2020
Merged

Add IsClosed method#1475
jarifibrahim merged 2 commits intomasterfrom
ibrahim/db-closed

Conversation

@jarifibrahim
Copy link
Contributor

@jarifibrahim jarifibrahim commented Aug 25, 2020

Add an IsClosed method which denotes if badger instance is closed or not.


This change is Reviewable

@jarifibrahim
Copy link
Contributor Author

This PR should be cherry picked to older versions.

Copy link
Contributor

@NamanJain8 NamanJain8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the close check need to be done at db.NewTransaction() too? Looks like not necessary, but I am not very sure.

@jarifibrahim
Copy link
Contributor Author

Does the close check need to be done at db.NewTransaction() too? Looks like not necessary, but I am not very sure.

I could add it over there as well but we don't necessarily need it. Creating a transaction is okay but when you do write you'll get a ErrDBClosed and when you do a read (via Get or an Iterator), we'll return error (or a panic if it's an iterator).

@jarifibrahim jarifibrahim merged commit 1e21a94 into master Aug 26, 2020
@jarifibrahim jarifibrahim deleted the ibrahim/db-closed branch August 26, 2020 10:03
jarifibrahim pushed a commit that referenced this pull request Aug 26, 2020
Add an IsClosed method which denotes if badger instance is closed or not.

(cherry picked from commit 1e21a94)
jarifibrahim pushed a commit that referenced this pull request Aug 26, 2020
Add an IsClosed method which denotes if badger instance is closed or not.

(cherry picked from commit 1e21a94)
jarifibrahim pushed a commit that referenced this pull request Oct 2, 2020
Add an IsClosed method which denotes if badger instance is closed or not.
mYmNeo added a commit to mYmNeo/badger that referenced this pull request Oct 23, 2023
mYmNeo added a commit to mYmNeo/badger that referenced this pull request Sep 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants