mirror of
https://github.com/certbot/certbot.git
synced 2026-06-05 06:42:10 -04:00
WIP on adding a random sleep for noninteractive renewal
This commit is contained in:
parent
15932dcafc
commit
3c57f47856
1 changed files with 10 additions and 0 deletions
|
|
@ -4,7 +4,9 @@ from __future__ import print_function
|
|||
import functools
|
||||
import logging.handlers
|
||||
import os
|
||||
import random
|
||||
import sys
|
||||
import time
|
||||
|
||||
import configobj
|
||||
import josepy as jose
|
||||
|
|
@ -1273,6 +1275,14 @@ def renew(config, unused_plugins):
|
|||
:rtype: None
|
||||
|
||||
"""
|
||||
if not sys.stdout.isatty():
|
||||
# Noninteractive renewals include a random delay in order to spread
|
||||
# out the load on the certificate authority servers, even if many
|
||||
# users all pick the same time for renewals. This delay precedes
|
||||
# running any hooks, so that side effects of the hooks (such as
|
||||
# shutting down a web service) aren't prolonged unnecessarily.
|
||||
time.sleep(random.randint(1, 60*8))
|
||||
|
||||
try:
|
||||
renewal.handle_renewal_request(config)
|
||||
finally:
|
||||
|
|
|
|||
Loading…
Reference in a new issue