mirror of
https://github.com/dkam/suo.git
synced 2025-01-29 07:42:43 +00:00
handle invalid lock data
This commit is contained in:
@@ -123,7 +123,7 @@ module Suo
|
||||
fail NotImplementedError
|
||||
end
|
||||
|
||||
def initial_set(key) # rubocop:disable Lint/UnusedMethodArgument
|
||||
def initial_set(key, val = "") # rubocop:disable Lint/UnusedMethodArgument
|
||||
fail NotImplementedError
|
||||
end
|
||||
|
||||
@@ -162,7 +162,7 @@ module Suo
|
||||
unpacked.map do |time, token|
|
||||
[Time.at(time), token]
|
||||
end
|
||||
rescue EOFError => _
|
||||
rescue EOFError, MessagePack::MalformedFormatError => _
|
||||
[]
|
||||
end
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@ module Suo
|
||||
@client.set_cas(key, newval, cas)
|
||||
end
|
||||
|
||||
def initial_set(key)
|
||||
@client.set(key, "")
|
||||
def initial_set(key, val = "")
|
||||
@client.set(key, val)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -32,8 +32,8 @@ module Suo
|
||||
@client.unwatch
|
||||
end
|
||||
|
||||
def initial_set(key)
|
||||
@client.set(key, "")
|
||||
def initial_set(key, val = "")
|
||||
@client.set(key, val)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user