Skip to content

Commit d920847

Browse files
committed
add evaluate time to the progress counter
1 parent 6231f82 commit d920847

File tree

1 file changed

+22
-11
lines changed

1 file changed

+22
-11
lines changed

reflex/app.py

+22-11
Original file line numberDiff line numberDiff line change
@@ -945,20 +945,16 @@ def get_compilation_time() -> str:
945945

946946
should_compile = self._should_compile()
947947

948-
for route in self._unevaluated_pages:
949-
console.debug(f"Evaluating page: {route}")
950-
self._compile_page(route, save_page=should_compile)
948+
if not should_compile:
949+
for route in self._unevaluated_pages:
950+
console.debug(f"Evaluating page: {route}")
951+
self._compile_page(route, save_page=should_compile)
951952

952-
# Add the optional endpoints (_upload)
953-
self._add_optional_endpoints()
953+
# Add the optional endpoints (_upload)
954+
self._add_optional_endpoints()
954955

955-
if not should_compile:
956956
return
957957

958-
self._validate_var_dependencies()
959-
self._setup_overlay_component()
960-
self._setup_error_boundary()
961-
962958
# Create a progress bar.
963959
progress = Progress(
964960
*Progress.get_default_columns()[:-1],
@@ -967,16 +963,31 @@ def get_compilation_time() -> str:
967963
)
968964

969965
# try to be somewhat accurate - but still not 100%
970-
adhoc_steps_without_executor = 6
966+
adhoc_steps_without_executor = 7
971967
fixed_pages_within_executor = 5
972968
progress.start()
973969
task = progress.add_task(
974970
f"[{get_compilation_time()}] Compiling:",
975971
total=len(self._pages)
972+
+ (len(self._unevaluated_pages) * 2)
976973
+ fixed_pages_within_executor
977974
+ adhoc_steps_without_executor,
978975
)
979976

977+
for route in self._unevaluated_pages:
978+
console.debug(f"Evaluating page: {route}")
979+
self._compile_page(route, save_page=should_compile)
980+
progress.advance(task)
981+
982+
# Add the optional endpoints (_upload)
983+
self._add_optional_endpoints()
984+
985+
self._validate_var_dependencies()
986+
self._setup_overlay_component()
987+
self._setup_error_boundary()
988+
989+
progress.advance(task)
990+
980991
# Get the env mode.
981992
config = get_config()
982993

0 commit comments

Comments
 (0)