diff --git a/docs/customization.rst b/docs/customization.rst index 98a9080d..2bc98401 100644 --- a/docs/customization.rst +++ b/docs/customization.rst @@ -745,8 +745,7 @@ Configuration Options .. confval:: sphinx_immaterial_font_fetch_max_workers The number of workers executed in parallel when fetching a cache of the specified - :themeconf:`font`. If not specified or set to :python:`0`, then the system's CPU - count is used by default. + :themeconf:`font`. If not specified, this defaults to using 33 maximum *possible* threads. .. _version_dropdown: diff --git a/sphinx_immaterial/google_fonts.py b/sphinx_immaterial/google_fonts.py index 5d47e3f1..c20e8203 100644 --- a/sphinx_immaterial/google_fonts.py +++ b/sphinx_immaterial/google_fonts.py @@ -61,7 +61,7 @@ def add_google_fonts(app: sphinx.application.Sphinx, fonts: List[str]): cache_dir = os.path.join(get_cache_dir(app), "google_fonts") static_dir = os.path.join(app.outdir, "_static") max_workers = cast( - int, app.config.config_values.get(_MAX_CONCURRENT_FETCHES_KEY, 0) + int, app.config.config_values.get(_MAX_CONCURRENT_FETCHES_KEY) ) if not max_workers: max_workers = os.cpu_count() or 1 @@ -205,7 +205,7 @@ def _builder_inited(app: sphinx.application.Sphinx): def setup(app: sphinx.application.Sphinx): app.setup_extension("sphinx_immaterial.external_resource_cache") app.connect("builder-inited", _builder_inited) - app.add_config_value(_MAX_CONCURRENT_FETCHES_KEY, default=0, rebuild="", types=int) + app.add_config_value(_MAX_CONCURRENT_FETCHES_KEY, default=33, rebuild="", types=int) return { "parallel_read_safe": True,