add evaluate time to the progress counter (#4722)
This commit is contained in:
parent
80a26b440d
commit
3cb4443128
@ -958,6 +958,7 @@ class App(MiddlewareMixin, LifespanMixin):
|
|||||||
|
|
||||||
should_compile = self._should_compile()
|
should_compile = self._should_compile()
|
||||||
|
|
||||||
|
if not should_compile:
|
||||||
for route in self._unevaluated_pages:
|
for route in self._unevaluated_pages:
|
||||||
console.debug(f"Evaluating page: {route}")
|
console.debug(f"Evaluating page: {route}")
|
||||||
self._compile_page(route, save_page=should_compile)
|
self._compile_page(route, save_page=should_compile)
|
||||||
@ -965,13 +966,8 @@ class App(MiddlewareMixin, LifespanMixin):
|
|||||||
# Add the optional endpoints (_upload)
|
# Add the optional endpoints (_upload)
|
||||||
self._add_optional_endpoints()
|
self._add_optional_endpoints()
|
||||||
|
|
||||||
if not should_compile:
|
|
||||||
return
|
return
|
||||||
|
|
||||||
self._validate_var_dependencies()
|
|
||||||
self._setup_overlay_component()
|
|
||||||
self._setup_error_boundary()
|
|
||||||
|
|
||||||
# Create a progress bar.
|
# Create a progress bar.
|
||||||
progress = Progress(
|
progress = Progress(
|
||||||
*Progress.get_default_columns()[:-1],
|
*Progress.get_default_columns()[:-1],
|
||||||
@ -980,16 +976,31 @@ 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 = 6
|
adhoc_steps_without_executor = 7
|
||||||
fixed_pages_within_executor = 5
|
fixed_pages_within_executor = 5
|
||||||
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)
|
||||||
+ fixed_pages_within_executor
|
+ fixed_pages_within_executor
|
||||||
+ adhoc_steps_without_executor,
|
+ adhoc_steps_without_executor,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
for route in self._unevaluated_pages:
|
||||||
|
console.debug(f"Evaluating page: {route}")
|
||||||
|
self._compile_page(route, save_page=should_compile)
|
||||||
|
progress.advance(task)
|
||||||
|
|
||||||
|
# Add the optional endpoints (_upload)
|
||||||
|
self._add_optional_endpoints()
|
||||||
|
|
||||||
|
self._validate_var_dependencies()
|
||||||
|
self._setup_overlay_component()
|
||||||
|
self._setup_error_boundary()
|
||||||
|
|
||||||
|
progress.advance(task)
|
||||||
|
|
||||||
# Get the env mode.
|
# Get the env mode.
|
||||||
config = get_config()
|
config = get_config()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user