fix failsafe on pipelined
refs CNVS-60234 `...` was stuffing the failsafe kwarg into a hash as the first non-kwarg Change-Id: Ia0b468416be130e1134b5e814f69faac9581f9f2 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/331323 Reviewed-by: Ryan Norton <rnorton@instructure.com> Product-Review: Ryan Norton <rnorton@instructure.com> Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> QA-Review: Cody Cutrer <cody@instructure.com>
This commit is contained in:
parent
24fb09df23
commit
551f264073
|
@ -44,9 +44,9 @@ module CanvasCache
|
|||
end
|
||||
|
||||
module IgnorePipelinedKey
|
||||
def pipelined(_key = nil, ...)
|
||||
def pipelined(_key = nil, **kwargs, &)
|
||||
# ignore key; only useful for distributed
|
||||
super(...)
|
||||
super(**kwargs, &)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -295,6 +295,15 @@ describe CanvasCache::Redis do
|
|||
allow(Process).to receive(:clock_gettime).and_return(now + 4)
|
||||
expect { redis_client.get("mykey") }.to raise_error(Redis::CannotConnectError)
|
||||
end
|
||||
|
||||
it "support failsafe with pipeline" do
|
||||
expect(redis_client.pipelined(failsafe: 2) { raise Redis::CannotConnectError }).to eq(2)
|
||||
end
|
||||
|
||||
it "support failsafe with pipeline on a distributed client" do
|
||||
client = Redis::Distributed.new([redis_client.id])
|
||||
expect(client.pipelined("key", failsafe: 2) { raise Redis::CannotConnectError }).to eq(2)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue