mirror of
https://github.com/rasbt/LLMs-from-scratch.git
synced 2026-04-10 12:33:42 +00:00
Fix GitHub CI timeout issue for link checker (#937)
* Fix GitHub CI timeout issue for link checker * update problematic links
This commit is contained in:
committed by
GitHub
parent
5f3268c2a6
commit
14c7afaa58
17
conftest.py
Normal file
17
conftest.py
Normal file
@@ -0,0 +1,17 @@
|
||||
import os
|
||||
import requests
|
||||
|
||||
|
||||
def pytest_configure(config):
|
||||
if not getattr(config.option, "check_links", False):
|
||||
return
|
||||
|
||||
timeout = float(os.environ.get("CHECK_LINKS_TIMEOUT", "10"))
|
||||
original_request = requests.sessions.Session.request
|
||||
|
||||
def request_with_timeout(self, method, url, **kwargs):
|
||||
if kwargs.get("timeout") is None:
|
||||
kwargs["timeout"] = timeout
|
||||
return original_request(self, method, url, **kwargs)
|
||||
|
||||
requests.sessions.Session.request = request_with_timeout
|
||||
Reference in New Issue
Block a user