Remove timeout FlareRequest
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Michel Roux 2022-12-21 17:48:31 +00:00
parent 4dee2ea36e
commit 0c6f893a6f
2 changed files with 4 additions and 5 deletions

View File

@ -15,7 +15,7 @@ ADMIN_USERNAME = environ.get('ADMIN_USERNAME', 'admin')
ADMIN_PASSWORD = environ.get('ADMIN_PASSWORD', 'secret') ADMIN_PASSWORD = environ.get('ADMIN_PASSWORD', 'secret')
APP_PORT = int(environ.get('FLASK_PORT', 5000)) APP_PORT = int(environ.get('FLASK_PORT', 5000))
CACHE_TIMEOUT = int(environ.get('CACHE_TIMEOUT', 60 * 60)) 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 [] BLACKLIST_WORDS = environ.get('BLACKLIST_WORDS', '').split(',') if environ.get('BLACKLIST_WORDS', '') else []
CLOUDPROXY_ENDPOINT = environ.get('CLOUDPROXY_ENDPOINT') CLOUDPROXY_ENDPOINT = environ.get('CLOUDPROXY_ENDPOINT')
DB_ENABLED = False DB_ENABLED = False

View File

@ -4,9 +4,9 @@ from .config import CLOUDPROXY_ENDPOINT, REQUESTS_TIMEOUT
class FlareRequests(Session): 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: 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() sessions = post(CLOUDPROXY_ENDPOINT, json={"cmd": "sessions.list"}).json()
@ -24,8 +24,7 @@ class FlareRequests(Session):
post_data = { post_data = {
"cmd": f"request.{method.lower()}", "cmd": f"request.{method.lower()}",
"session": FLARESESSION, "session": FLARESESSION,
"url": url, "url": url
"maxTimeout": timeout * 1000,
} }
if params: if params: