Skip to content

Commit

Permalink
fix(etcd) fix etcd storage with v3 protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
fffonion committed Aug 4, 2024
1 parent 754ac40 commit 51530a1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/resty/acme/storage/etcd.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ end

-- set the key regardless of it's existence
function _M:set(k, v, ttl)
if not self.protocol_is_v2 then
ttl = { lease = ttl }
end
local _, err = self.client:set(k, v, ttl)
if err then
return err
Expand All @@ -35,6 +38,9 @@ end

-- set the key only if the key doesn't exist
function _M:add(k, v, ttl)
if not self.protocol_is_v2 then
ttl = { lease = ttl }
end
local res, err = self.client:setnx(k, v, ttl)
if err then
return err
Expand Down

0 comments on commit 51530a1

Please sign in to comment.