From 5387eb0eb1ee0fc090ca4b02bb95580d546b9d4b Mon Sep 17 00:00:00 2001 From: Max Wang Date: Fri, 18 Aug 2023 15:19:34 -0400 Subject: [PATCH] Run black --- strider/server.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/strider/server.py b/strider/server.py index a2ff6e56..3f55f14b 100644 --- a/strider/server.py +++ b/strider/server.py @@ -331,7 +331,11 @@ async def sync_query( # get max timeout timeout_seconds = (query_dict.get("parameters") or {}).get("timeout_seconds") # if timeout_seconds, less 10 seconds to account for sending back - timeout = timeout_seconds - 10 if type(timeout_seconds) is int else settings.max_process_time + timeout = ( + timeout_seconds - 10 + if type(timeout_seconds) is int + else settings.max_process_time + ) query_results = await asyncio.wait_for(lookup(query_dict, qid), timeout=timeout) except asyncio.TimeoutError: LOGGER.error(f"[{qid}] Sync query cancelled due to timeout.") @@ -527,7 +531,11 @@ async def async_lookup( # get max timeout timeout_seconds = (query_dict.get("parameters") or {}).get("timeout_seconds") # if timeout_seconds, less 10 seconds to account for sending back - timeout = timeout_seconds - 10 if type(timeout_seconds) is int else settings.max_process_time + timeout = ( + timeout_seconds - 10 + if type(timeout_seconds) is int + else settings.max_process_time + ) query_results = await asyncio.wait_for(lookup(query_dict, qid), timeout=timeout) except asyncio.TimeoutError: LOGGER.error(f"[{qid}]: Process cancelled due to timeout.") @@ -562,7 +570,11 @@ async def single_lookup(query_key): "timeout_seconds" ) # if timeout_seconds, less 10 seconds to account for sending back - timeout = timeout_seconds - 10 if type(timeout_seconds) is int else settings.max_process_time + timeout = ( + timeout_seconds - 10 + if type(timeout_seconds) is int + else settings.max_process_time + ) query_result = await asyncio.wait_for( lookup(queries[query_key], qid), timeout=timeout )