Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix bug with redis connection handling.

Previously, it was just using the default connection
of `localhost:6379`, regardless if you setup your
app with an `Ost.connect`.

With this change, the redis object is passed properly
to the constructor of the Queue object.

credits: thanks to @conanbatt for spotting this.
  • Loading branch information...
commit 67c8e509f9e17157c323acc1c35db393d30c4803 1 parent 2113eb1
@cyx cyx authored
Showing with 7 additions and 1 deletion.
  1. +1 −1  lib/ost.rb
  2. +6 −0 test/ost_test.rb
View
2  lib/ost.rb
@@ -9,7 +9,7 @@ class Queue
attr :backup
def initialize(name)
- @key = Nest.new(:ost)[name]
+ @key = Nest.new(:ost, redis)[name]
@backup = @key[Socket.gethostname][Process.pid]
end
View
6 test/ost_test.rb
@@ -129,4 +129,10 @@ def enqueue(id)
assert_equal 0, Ost[:events].backup.llen
assert_equal false, Ost[:events].backup.exists
end
+
+ test "uses same redis instance" do
+ queue = Ost['foo']
+
+ assert_equal queue.key.redis, queue.redis
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.