diff --git a/.travis.yml b/.travis.yml index a8b6b9d..c7240ee 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,8 @@ python: env: global: - SECRET_KEY=justfortravis + - DNS_RESOLVER_TIMEOUT=15.0 + - DNS_UPDATE_TIMEOUT=30.0 matrix: - DJANGO=1.5.5 - DJANGO=1.6.1 diff --git a/nsupdate/main/dnstools.py b/nsupdate/main/dnstools.py index c7042c5..e6bb931 100644 --- a/nsupdate/main/dnstools.py +++ b/nsupdate/main/dnstools.py @@ -4,11 +4,13 @@ Misc. DNS related code: query, dynamic update, etc. Usually, higher level code wants to call the add/update/delete functions. """ +import os + # time to wait for dns name resolving [s] -RESOLVER_TIMEOUT = 5.0 +RESOLVER_TIMEOUT = float(os.environ.get('DNS_RESOLVER_TIMEOUT', '5.0')) # time to wait for dns name updating [s] -UPDATE_TIMEOUT = 20.0 +UPDATE_TIMEOUT = float(os.environ.get('DNS_UPDATE_TIMEOUT', '20.0')) # time after we retry to reach a previously unreachable ns [s] UNAVAILABLE_RETRY = 300.0