dnstools: make timeouts configurable via ENV, travis: use longer timeouts

This commit is contained in:
Thomas Waldmann 2013-12-13 03:04:00 +01:00
parent cc4cd1c805
commit e2e07b60e3
2 changed files with 6 additions and 2 deletions

View File

@ -6,6 +6,8 @@ python:
env: env:
global: global:
- SECRET_KEY=justfortravis - SECRET_KEY=justfortravis
- DNS_RESOLVER_TIMEOUT=15.0
- DNS_UPDATE_TIMEOUT=30.0
matrix: matrix:
- DJANGO=1.5.5 - DJANGO=1.5.5
- DJANGO=1.6.1 - DJANGO=1.6.1

View File

@ -4,11 +4,13 @@ Misc. DNS related code: query, dynamic update, etc.
Usually, higher level code wants to call the add/update/delete functions. Usually, higher level code wants to call the add/update/delete functions.
""" """
import os
# time to wait for dns name resolving [s] # 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] # 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] # time after we retry to reach a previously unreachable ns [s]
UNAVAILABLE_RETRY = 300.0 UNAVAILABLE_RETRY = 300.0