Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure the first segment is not empty or it's not complete (is current) #40

Merged
merged 1 commit into from
Oct 23, 2024

Conversation

nikolaydimitrov
Copy link
Contributor

In an edge case, on load, we found that it is possible to have the first segment being empty (size()==0) and also complete (reached q.config.ItemsPerSegment limit).
In such queue, the Peek() and Deque() return error 'empty', but that is not correct as the queue has another segment with available objects.

@joncrlsn joncrlsn merged commit 541ab71 into joncrlsn:v2 Oct 23, 2024
2 of 3 checks passed
@joncrlsn
Copy link
Owner

joncrlsn commented Oct 23, 2024 via email

@nikolaydimitrov
Copy link
Contributor Author

Hi, Jon.
Thanks for the quick merge! I actually realised that those segments above need to be also deleted, otherwise they will stay on the filesystem forever. I will create another PR for that.
As for the maintenance, I am open to do that as we are using dque in production code and I am comfortable with the code already.

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.

2 participants