Skip to content

Commit

Permalink
disconnect on shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Kaes authored and djanowski committed Oct 24, 2011
1 parent 959d926 commit f2bf2a3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/redis.rb
Expand Up @@ -1009,7 +1009,11 @@ def quit
# Synchronously save the dataset to disk and then shut down the server.
def shutdown
synchronize do
@client.call_without_reply [:shutdown]
begin
@client.call_without_reply [:shutdown]
ensure
@client.disconnect
end
end
end

Expand Down
1 change: 1 addition & 0 deletions test/connection_handling_test.rb
Expand Up @@ -49,6 +49,7 @@

# SHUTDOWN does not reply: test that it does not raise here.
assert nil == redis.shutdown
assert !redis.client.connected?
end
end

Expand Down

0 comments on commit f2bf2a3

Please sign in to comment.