Skip to content

Commit

Permalink
fix(autossl) increase cert lock time (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
kfigiela authored Aug 9, 2021
1 parent 261194c commit efb0602
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/resty/acme/autossl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ local domain_whitelist, domain_whitelist_callback
local certs_cache = {}
local CERTS_CACHE_TTL = 3600
local CERTS_CACHE_NEG_TTL = 5
local CERTS_LOCK_TTL = 300


local update_cert_lock_key_prefix = "update_lock:"
Expand Down Expand Up @@ -225,7 +226,7 @@ function AUTOSSL.update_cert(data)
-- you submit an order with different CSR while the previous order is still pending
-- you will get the previous order (with `expires` capped to an integer second).
local lock_key = update_cert_lock_key_prefix .. ":" .. data.domain
local err = AUTOSSL.storage:add(lock_key, "1", CERTS_CACHE_NEG_TTL)
local err = AUTOSSL.storage:add(lock_key, "1", CERTS_LOCK_TTL)
if err then
ngx.log(ngx.INFO,
"update is already running (lock key ", lock_key, " exists), current type ", data.type)
Expand Down

0 comments on commit efb0602

Please sign in to comment.