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

Fix 0 capacity issue. now cache_size can be 0 #187

Merged
merged 1 commit into from
Jan 27, 2018

Conversation

wuarmin
Copy link
Contributor

@wuarmin wuarmin commented Jan 27, 2018

I encountered a problem while setting cache_size to 0. The result was an unlimited cache because in python "0" evaluates to false. This PR would fix this.

kind regards

@wuarmin
Copy link
Contributor Author

wuarmin commented Jan 27, 2018

@msiemens Do you know why the test-build with Python 2.6 failed?

@msiemens
Copy link
Owner

Thanks for the Pull Request! 🙂

@msiemens Do you know why the test-build with Python 2.6 failed?

This is due to #185 where it's still up to debate whether or not to drop Python 2.6 as our test infrastructure has dropped support for it.

@msiemens msiemens merged commit 3fcbd4c into msiemens:master Jan 27, 2018
@wuarmin
Copy link
Contributor Author

wuarmin commented Jan 27, 2018

@msiemens All right. I 'll provide another to provide the option to disable cache explicitly. (We talked about it at #179 )

@wuarmin wuarmin deleted the fixes/fix_capacity_0_issue branch January 27, 2018 19:11
@msiemens
Copy link
Owner

Actually, I'm just thinking about if the best way to disable the query cache would be to actually use a cache_size of 0 and in this case skip the query cache logic or replace the cache with an class that has the same interface/api but doesn't perform any caching. This may make the API a little less nosiy compared to adding a new argument – if we document this properly. What do you think?

@wuarmin
Copy link
Contributor Author

wuarmin commented Jan 29, 2018

@msiemens Yes, I think you are right. Defining a cache_size of zero, fullfills the purpose. Another option is not necessary.

@msiemens
Copy link
Owner

msiemens commented Mar 1, 2018

This is now released in v3.8.0 🙂

@wuarmin
Copy link
Contributor Author

wuarmin commented Mar 3, 2018

@msiemens
great!
The latest version in python package index is still 3.7.0.
If I want to upgrade I get following message:

CRITICAL:pip.index:Could not find a version that satisfies the requirement tinydb==3.8.0 (from versions: 1.0.0, 1.0.1, 1.1.0, 1.1.1, 1.2.0, 1.3.0, 1.4.0, 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.2.1, 2.2.2, 2.3.0b0, 2.3.1, 2.3.1.post1, 2.3.1.post2, 2.3.2, 2.4, 3.0.0, 3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.2.0, 3.2.1, 3.2.2, 3.2.3, 3.3.0, 3.3.1, 3.4.0, 3.4.1, 3.5.0, 3.6.0, 3.7.0)

@msiemens
Copy link
Owner

msiemens commented Mar 3, 2018

Whoops! Forgot to publish it on PyPI, sorry! Should work now 🙂

@wuarmin
Copy link
Contributor Author

wuarmin commented Mar 3, 2018

thanks! 👍 I'm on 3.8.0 😄

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