diff --git a/pynyaata/config.py b/pynyaata/config.py index 83049d9..6d87431 100644 --- a/pynyaata/config.py +++ b/pynyaata/config.py @@ -15,7 +15,7 @@ ADMIN_USERNAME = environ.get('ADMIN_USERNAME', 'admin') ADMIN_PASSWORD = environ.get('ADMIN_PASSWORD', 'secret') APP_PORT = int(environ.get('FLASK_PORT', 5000)) CACHE_TIMEOUT = int(environ.get('CACHE_TIMEOUT', 60 * 60)) -REQUESTS_TIMEOUT = int(environ.get('REQUESTS_TIMEOUT', 10)) +REQUESTS_TIMEOUT = int(environ.get('REQUESTS_TIMEOUT', 5)) BLACKLIST_WORDS = environ.get('BLACKLIST_WORDS', '').split(',') if environ.get('BLACKLIST_WORDS', '') else [] CLOUDPROXY_ENDPOINT = environ.get('CLOUDPROXY_ENDPOINT') DB_ENABLED = False diff --git a/pynyaata/flarerequests.py b/pynyaata/flarerequests.py index 95e05ef..2d6efed 100644 --- a/pynyaata/flarerequests.py +++ b/pynyaata/flarerequests.py @@ -4,9 +4,9 @@ from .config import CLOUDPROXY_ENDPOINT, REQUESTS_TIMEOUT class FlareRequests(Session): - def request(self, method, url, params=None, timeout=REQUESTS_TIMEOUT, **kwargs): + def request(self, method, url, params=None, **kwargs): if not CLOUDPROXY_ENDPOINT: - return super().request(method, url, params, timeout=timeout, **kwargs) + return super().request(method, url, params, **kwargs) sessions = post(CLOUDPROXY_ENDPOINT, json={"cmd": "sessions.list"}).json() @@ -24,8 +24,7 @@ class FlareRequests(Session): post_data = { "cmd": f"request.{method.lower()}", "session": FLARESESSION, - "url": url, - "maxTimeout": timeout * 1000, + "url": url } if params: