add compilation time in log (#3563)

This commit is contained in:
Thomas Brandého 2024-06-26 18:58:35 +02:00 committed by GitHub
parent 237aa22306
commit 3c8179d987
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -13,6 +13,7 @@ import multiprocessing
import os
import platform
import sys
from datetime import datetime
from typing import (
Any,
AsyncIterator,
@ -836,6 +837,9 @@ class App(LifespanMixin, Base):
"""
from reflex.utils.exceptions import ReflexRuntimeError
def get_compilation_time() -> str:
return str(datetime.now().time()).split(".")[0]
# Render a default 404 page if the user didn't supply one
if constants.Page404.SLUG not in self.pages:
self.add_custom_404_page()
@ -861,7 +865,7 @@ class App(LifespanMixin, Base):
fixed_pages_within_executor = 5
progress.start()
task = progress.add_task(
"Compiling:",
f"[{get_compilation_time()}] Compiling:",
total=len(self.pages)
+ fixed_pages_within_executor
+ adhoc_steps_without_executor,