From d9208475d05801ab9599ad6118f89c49d5556c9d Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Fri, 31 Jan 2025 11:40:45 -0800 Subject: [PATCH] add evaluate time to the progress counter --- reflex/app.py | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/reflex/app.py b/reflex/app.py index 9fe0f2992..bb9069683 100644 --- a/reflex/app.py +++ b/reflex/app.py @@ -945,19 +945,15 @@ class App(MiddlewareMixin, LifespanMixin): should_compile = self._should_compile() - for route in self._unevaluated_pages: - console.debug(f"Evaluating page: {route}") - self._compile_page(route, save_page=should_compile) - - # Add the optional endpoints (_upload) - self._add_optional_endpoints() - if not should_compile: - return + for route in self._unevaluated_pages: + console.debug(f"Evaluating page: {route}") + self._compile_page(route, save_page=should_compile) - self._validate_var_dependencies() - self._setup_overlay_component() - self._setup_error_boundary() + # Add the optional endpoints (_upload) + self._add_optional_endpoints() + + return # Create a progress bar. progress = Progress( @@ -967,16 +963,31 @@ class App(MiddlewareMixin, LifespanMixin): ) # try to be somewhat accurate - but still not 100% - adhoc_steps_without_executor = 6 + adhoc_steps_without_executor = 7 fixed_pages_within_executor = 5 progress.start() task = progress.add_task( f"[{get_compilation_time()}] Compiling:", total=len(self._pages) + + (len(self._unevaluated_pages) * 2) + fixed_pages_within_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. config = get_config()