-
Notifications
You must be signed in to change notification settings - Fork 68
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 deadlocks, small improvements #33
base: master
Are you sure you want to change the base?
Conversation
@@ -211,7 +228,7 @@ | |||
end | |||
|
|||
it "without time support should return the same time as frozen time" do | |||
expect(@redis).to receive(:time).and_raise(Redis::CommandError) | |||
expect(semaphore.instance_variable_get(:@redis)).to receive(:time).and_raise(Redis::CommandError) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [103/80]
9e1f84b
to
19d6f11
Compare
@@ -211,7 +228,8 @@ | |||
end | |||
|
|||
it "without time support should return the same time as frozen time" do | |||
expect(@redis).to receive(:time).and_raise(Redis::CommandError) | |||
expect(semaphore.instance_variable_get(:@redis)).to receive(:time) | |||
.and_raise(Redis::CommandError) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Place the . on the previous line, together with the method call receiver.
Hey @mediaslave24 thanks for contributing. However I found some problems with your code. Could you go through my comments and update, then I'll merge. Thanks! |
Fix deadlocks from #18.
Initialize redis after use_local_time, because use_local_time is incorrect option for redis client.
Use Enumerable#find in #locked? method for shorter code and don't shadow outer "token" variable.
Don't depend on calls to another methods in #create! (set the value right here).