You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I presume this is supposed to be a way for users to monkeypatch a lower (or higher) concurrency limit to help with network issues, but it isn't used in the call to ThreadPoolExecutor.
Presuming my understanding is correct, is this the right fix?
diff --git a/sphinx_immaterial/google_fonts.py b/sphinx_immaterial/google_fonts.py
index 8f355063..80bef6d3 100644
--- a/sphinx_immaterial/google_fonts.py+++ b/sphinx_immaterial/google_fonts.py@@ -64,7 +64,7 @@ def add_google_fonts(app: sphinx.application.Sphinx, fonts: List[str]):
font_dir = os.path.join(static_dir, "fonts")
os.makedirs(font_dir, exist_ok=True)
- with concurrent.futures.ThreadPoolExecutor(max_workers=33) as executor:+ with concurrent.futures.ThreadPoolExecutor(max_workers=_MAX_CONCURRENT_FETCHES) as executor:
def to_thread(fn, *args, **kwargs) -> asyncio.Future:
return asyncio.wrap_future(executor.submit(fn, *args, **kwargs))
The text was updated successfully, but these errors were encountered:
If the purpose of the variable is to allow user customization, then it should be exposed as a config option. I'd rather not encourage monkey patching when it isn't necessary.
And yes, the suggested patch would be the solution if user customization is not preferred for some reason.
The
_MAX_CONCURRENT_FETCHES
module variable insphinx_immaterial.google_fonts
is currently unused:I presume this is supposed to be a way for users to monkeypatch a lower (or higher) concurrency limit to help with network issues, but it isn't used in the call to
ThreadPoolExecutor
.Presuming my understanding is correct, is this the right fix?
The text was updated successfully, but these errors were encountered: