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

Add handling covering incr/3 on non-numeric keys #18

Merged
merged 1 commit into from
Apr 19, 2016
Merged

Conversation

whitfin
Copy link
Owner

@whitfin whitfin commented Apr 19, 2016

Currently there's a bug in decr/3 and incr/3 in that if you create a non-numeric value beforehand, a call to either will crash the server.

This PR will add coverage around this issue and resolve it in all workers. I also added handling to get_and_update/4 to better support transactions and unrecognised errors.

You can now Cachex.abort(worker, :reason) from inside a get_and_update/4 call to exit early and not commit the changes, and { :error, :reason } will be returned.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 4b92160 on non-numeric-incr into 2d8353b on master.

@whitfin whitfin merged commit 6f41471 into master Apr 19, 2016
@whitfin whitfin deleted the non-numeric-incr branch April 19, 2016 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants