mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2024-11-08 14:40:27 +00:00
Update utils.py
add timeout requests.request for large zones
This commit is contained in:
parent
5e1898c47a
commit
1ccd98a364
@ -3,6 +3,9 @@ import sys
|
||||
import json
|
||||
import requests
|
||||
import urlparse
|
||||
from app import app
|
||||
|
||||
TIMEOUT = app.config['TIMEOUT']
|
||||
|
||||
def auth_from_url(url):
|
||||
auth = None
|
||||
@ -18,7 +21,7 @@ def fetch_remote(remote_url, method='GET', data=None, accept=None, params=None,
|
||||
data = json.dumps(data)
|
||||
|
||||
if timeout is None:
|
||||
timeout = 1.5
|
||||
timeout = TIMEOUT
|
||||
|
||||
verify = False
|
||||
|
||||
@ -125,4 +128,4 @@ def display_time(amount, units='s', remove_seconds=True):
|
||||
final_string = final_string[:final_string.rfind(' ')]
|
||||
return final_string[:final_string.rfind(' ')]
|
||||
|
||||
return final_string
|
||||
return final_string
|
||||
|
Loading…
Reference in New Issue
Block a user