Removed unnecessary delays in the code. These are now implemented entirely by systemd instead
This commit is contained in:
@ -7,7 +7,6 @@
|
||||
# with certbot)
|
||||
|
||||
import os
|
||||
import random
|
||||
import requests
|
||||
import time
|
||||
from DnsRecordDeleter import delete_dns_record
|
||||
@ -31,15 +30,6 @@ record = {
|
||||
"rrset_values": [validation_token],
|
||||
}
|
||||
|
||||
# Due to there being multiple subdomains being requested, this
|
||||
# script will be invoked multiple times with different domain
|
||||
# values. As such, to avoid conflicts, we will delay each run
|
||||
# of this script a random number of seconds, between 0 and 180
|
||||
# to make sure there are no conflicts between the separate
|
||||
# runs of this script
|
||||
random_nr = random.randrange(0, 180)
|
||||
time.sleep(random_nr)
|
||||
|
||||
response = requests.post(LIVEDNS_API_URL + '/' + domain
|
||||
+ '/records', headers=headers, json=record)
|
||||
|
||||
@ -47,5 +37,3 @@ if not response.ok:
|
||||
logger.error('Could not create proper DNS record for LETSENCRYPT')
|
||||
logger.error(response.raise_for_status())
|
||||
exit(1)
|
||||
|
||||
time.sleep(30)
|
||||
|
Reference in New Issue
Block a user