diff --git a/PFERD/crawl/http_crawler.py b/PFERD/crawl/http_crawler.py index facc2ba..45f9df2 100644 --- a/PFERD/crawl/http_crawler.py +++ b/PFERD/crawl/http_crawler.py @@ -67,12 +67,18 @@ class HttpCrawler(Crawler): the request was made. This ensures that authentication is not performed needlessly. """ async with self._authentication_lock: + log.explain_topic("Authenticating") # Another thread successfully called authenticate in-between # We do not want to perform auth again, so we return here. We can # assume the other thread suceeded as authenticate will throw an error # if it failed and aborts the crawl process. if caller_auth_id != self._authentication_id: + log.explain( + "Authentication skipped due to auth id mismatch." + "A previous authentication beat us to the race." + ) return + log.explain("Calling crawler-specific authenticate") await self._authenticate() self._authentication_id += 1 # Saving the cookies after the first auth ensures we won't need to re-authenticate