From 583eec7286c86d217ef80889780b3308694d325e Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Fri, 25 Oct 2024 15:17:42 -0700 Subject: [PATCH] remove unused code --- reflex/app.py | 35 ++--------------------------------- 1 file changed, 2 insertions(+), 33 deletions(-) diff --git a/reflex/app.py b/reflex/app.py index 10a78dbc2..557c95358 100644 --- a/reflex/app.py +++ b/reflex/app.py @@ -883,7 +883,7 @@ class App(MiddlewareMixin, LifespanMixin, Base): progress.start() task = progress.add_task( f"[{get_compilation_time()}] Compiling:", - total=len(self.unevaluated_pages) + total=len(self.pages) + fixed_pages_within_executor + adhoc_steps_without_executor, ) @@ -948,38 +948,16 @@ class App(MiddlewareMixin, LifespanMixin, Base): for route, component in zip(self.pages, page_components): ExecutorSafeFunctions.COMPONENTS[route] = component - for route, page in self.unevaluated_pages.items(): - if route in self.pages: - continue - - ExecutorSafeFunctions.UNCOMPILED_PAGES[route] = page - ExecutorSafeFunctions.STATE = self.state - pages_results = [] - with executor: result_futures = [] - pages_futures = [] def _submit_work(fn, *args, **kwargs): f = executor.submit(fn, *args, **kwargs) # f = executor.apipe(fn, *args, **kwargs) result_futures.append(f) - # Compile all page components. - for route in self.unevaluated_pages: - if route in self.pages: - continue - - f = executor.submit( - ExecutorSafeFunctions.compile_unevaluated_page, - route, - self.style, - self.theme, - ) - pages_futures.append(f) - # Compile the pre-compiled pages. for route in self.pages: _submit_work( @@ -1007,16 +985,7 @@ class App(MiddlewareMixin, LifespanMixin, Base): compile_results.append(future.result()) progress.advance(task) - for future in concurrent.futures.as_completed(pages_futures): - pages_results.append(future.result()) - progress.advance(task) - - for route, component, compiled_page in pages_results: - self._check_routes_conflict(route) - self.pages[route] = component - compile_results.append(compiled_page) - - for _, component in self.pages.items(): + for component in self.pages.values(): # Add component._get_all_imports() to all_imports. all_imports.update(component._get_all_imports())