Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase cert lock time #47

Merged
merged 1 commit into from
Aug 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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