-
Notifications
You must be signed in to change notification settings - Fork 130
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
autocommit does not commit if program exits #93
Comments
You're right. If the program exits, all internal threads / queues are discarded by Python/OS, at indeterminate time. I'm not sure what we could do about it on our end… @mpenkov maybe make some operations (like commit) blocking, instead of using background threads and queues? |
I thought commit was blocking already. This comment implies it's blocking: #52 (comment) |
A commit should definitely be blocking IMO. If true, I consider this a bug. Thanks for reporting. I'm not sure when I'll get to fixing this -- please feel free to suggest a PR. |
"commit" is blocking, but "autocommit" is not. I think this would be as simple as calling "commit" as part of setitem, if "autocommit" is True. |
OK, go for it! PR welcome. |
My PR fixes the problem for me. Is there anything more I need to do? |
Is there anything more I can do to assist in getting this fix merged? |
I see this issue is closed, but the most recent released version of this project is from 2018. Are there any plans on doing another release soon? It would be nice to be able to use auto-commit from the official released version. |
@mpenkov WDYT? |
Yes, I will do a new release tomorrow. |
Forgot to post the URL to the new version here: https://pypi.org/project/sqlitedict/1.7.0/ |
Great. That seems to work (including with pip), so that satisfies my technical requirements, but it is NOT listed as the "latest release" on github. 1.6.0 is still listed as the "latest" release. |
Thank you for pointing that out. Should be fixed now: https://github.com/RaRe-Technologies/sqlitedict/releases/tag/1.7.0 |
I ran into a problem in one of my programs where it was not committing some changes because my script exited shortly after the updates.
Here is a example script that reliably reproduces the effect (for me):
If I follow that up with a select, I only see 18 entries (sometimes I see zero entries):
The text was updated successfully, but these errors were encountered: