move the loop one step inside
@@ -78,9 +78,9 @@ class TwistcliIntegration(ABC):
request_max_tries = int(os.getenv('REQUEST_MAX_TRIES', 3))
sleep_between_request_tries = float(os.getenv('SLEEP_BETWEEN_REQUEST_TRIES', 1))
+ async with aiohttp.ClientSession(connector=aiohttp.TCPConnector(resolver=aiohttp.AsyncResolver())) as session:
for i in range(request_max_tries):
logging.info(f"[twistcli](report_results_async) reporting attempt {i + 1} out of {request_max_tries}")
- async with aiohttp.ClientSession(connector=aiohttp.TCPConnector(resolver=aiohttp.AsyncResolver())) as session:
async with session.post(
url=f'{bc_integration.api_url}{self.vulnerabilities_base_path}/results', headers=headers, json=payload
) as response:
