Closed endlisnis closed 4 years ago
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: https://github.com/RaRe-Technologies/sqlitedict/issues/52#issuecomment-336732757
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/
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):