|
@@ -1235,14 +1235,16 @@ class App(MiddlewareMixin, LifespanMixin):
|
|
|
|
|
|
# try to be somewhat accurate - but still not 100%
|
|
# try to be somewhat accurate - but still not 100%
|
|
adhoc_steps_without_executor = 7
|
|
adhoc_steps_without_executor = 7
|
|
- fixed_pages_within_executor = 5
|
|
|
|
|
|
+ fixed_pages_within_executor = 4
|
|
|
|
+ plugin_count = len(config.plugins)
|
|
progress.start()
|
|
progress.start()
|
|
task = progress.add_task(
|
|
task = progress.add_task(
|
|
f"[{get_compilation_time()}] Compiling:",
|
|
f"[{get_compilation_time()}] Compiling:",
|
|
total=len(self._pages)
|
|
total=len(self._pages)
|
|
+ (len(self._unevaluated_pages) * 2)
|
|
+ (len(self._unevaluated_pages) * 2)
|
|
+ fixed_pages_within_executor
|
|
+ fixed_pages_within_executor
|
|
- + adhoc_steps_without_executor,
|
|
|
|
|
|
+ + adhoc_steps_without_executor
|
|
|
|
+ + plugin_count,
|
|
)
|
|
)
|
|
|
|
|
|
with console.timing("Evaluate Pages (Frontend)"):
|
|
with console.timing("Evaluate Pages (Frontend)"):
|
|
@@ -1412,9 +1414,17 @@ class App(MiddlewareMixin, LifespanMixin):
|
|
# Compile the theme.
|
|
# Compile the theme.
|
|
_submit_work(compile_theme, self.style)
|
|
_submit_work(compile_theme, self.style)
|
|
|
|
|
|
|
|
+ def _submit_work_without_advancing(
|
|
|
|
+ fn: Callable[P, list[tuple[str, str]] | tuple[str, str] | None],
|
|
|
|
+ *args: P.args,
|
|
|
|
+ **kwargs: P.kwargs,
|
|
|
|
+ ):
|
|
|
|
+ f = executor.submit(fn, *args, **kwargs)
|
|
|
|
+ result_futures.append(f)
|
|
|
|
+
|
|
for plugin in config.plugins:
|
|
for plugin in config.plugins:
|
|
plugin.pre_compile(
|
|
plugin.pre_compile(
|
|
- add_save_task=_submit_work,
|
|
|
|
|
|
+ add_save_task=_submit_work_without_advancing,
|
|
add_modify_task=(
|
|
add_modify_task=(
|
|
lambda *args, plugin=plugin: modify_files_tasks.append(
|
|
lambda *args, plugin=plugin: modify_files_tasks.append(
|
|
(
|
|
(
|
|
@@ -1433,6 +1443,8 @@ class App(MiddlewareMixin, LifespanMixin):
|
|
else:
|
|
else:
|
|
compile_results.append(result)
|
|
compile_results.append(result)
|
|
|
|
|
|
|
|
+ progress.advance(task, advance=len(config.plugins))
|
|
|
|
+
|
|
app_root = self._app_root(app_wrappers=app_wrappers)
|
|
app_root = self._app_root(app_wrappers=app_wrappers)
|
|
|
|
|
|
# Get imports from AppWrap components.
|
|
# Get imports from AppWrap components.
|