Skip to content

Commit

Permalink
debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Aug 21, 2024
1 parent 65e2e5d commit 5f0db14
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions bbot/core/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def unpickle(self, binary):
async def _infinite_retry(self, callback, *args, **kwargs):
interval = kwargs.pop("_interval", 300)
context = kwargs.pop("_context", "")
# default overall timeout of 5 minutes (15 second interval * 20 iterations)
# default overall timeout of 10 minutes (300 second interval * 2 iterations)
max_retries = kwargs.pop("_max_retries", 1)
if not context:
context = f"{callback.__name__}({args}, {kwargs})"
Expand All @@ -77,7 +77,7 @@ async def _infinite_retry(self, callback, *args, **kwargs):
self.log.debug(f"{self.name}: Timeout after {interval:,} seconds {context}, retrying...")
retries += 1
if max_retries is not None and retries > max_retries:
raise TimeoutError(f"Timed out after {max_retries*interval:,} seconds {context}")
raise TimeoutError(f"Timed out after {(max_retries+1)*interval:,} seconds {context}")

def engine_debug(self, *args, **kwargs):
if self._engine_debug:
Expand Down
2 changes: 1 addition & 1 deletion bbot/core/helpers/web/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def __init__(self, *args, **kwargs):
proxies = self._web_config.get("http_proxy", None)
kwargs["proxies"] = proxies

log.debug(f"Creating httpx.AsyncClient({args}, {kwargs})")
log.critical(f"Creating httpx.AsyncClient({args}, {kwargs})")
super().__init__(*args, **kwargs)
if not self._persist_cookies:
self._cookies = DummyCookies()
Expand Down
1 change: 1 addition & 0 deletions bbot/core/helpers/web/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def AsyncClient(self, *args, **kwargs):
try:
return self.web_clients[retries]
except KeyError:
log.critical('CREATING CLIENT')
from .client import BBOTAsyncClient

client = BBOTAsyncClient.from_config(self.config, self.target, *args, **kwargs)
Expand Down

0 comments on commit 5f0db14

Please sign in to comment.