Closed craigmaloney closed 5 years ago
:exclamation: No coverage uploaded for pull request base (
master@f468948
). Click here to learn what that means. The diff coverage is100%
.
@@ Coverage Diff @@
## master #54 +/- ##
=======================================
Coverage ? 100%
=======================================
Files ? 32
Lines ? 2653
Branches ? 0
=======================================
Hits ? 2653
Misses ? 0
Partials ? 0
Impacted Files | Coverage Δ | |
---|---|---|
eeweather/cache.py | 100% <100%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update f468948...9b07419. Read the comment docs.
Seems like a great idea to me. I think that was the only place the key_exists function was being used, so we may also want to strip that out? Not sure about that. Regardless, this looks to me to be ready for a merge.
The "key_exists" function could still be useful outside of context to query if it exists. I know we use it as a kind of cache primer on our end to ensure that the cache exists (we test to see if an invalid key is in there). There could be other unexpected uses of that function out there. :grin:
Sounds good. Released as eeweather==0.3.20. Thanks again!
Your checklist for this pull request
Please review the guidelines for contributing to this repository.
docker-compose run --rm test
.docker-compose run --rm blacken
.Description
This resolves an issue in multi-process environments where multiple workers can retrieve a record and then try to insert them at the same time. This tries an insert first and then updates the record if the insertion fails. The difference between this and existing code is it doesn't poll for the key first (which might have changed in the interim).