add compilation time in log (#3563)
This commit is contained in:
parent
237aa22306
commit
3c8179d987
@ -13,6 +13,7 @@ import multiprocessing
|
|||||||
import os
|
import os
|
||||||
import platform
|
import platform
|
||||||
import sys
|
import sys
|
||||||
|
from datetime import datetime
|
||||||
from typing import (
|
from typing import (
|
||||||
Any,
|
Any,
|
||||||
AsyncIterator,
|
AsyncIterator,
|
||||||
@ -836,6 +837,9 @@ class App(LifespanMixin, Base):
|
|||||||
"""
|
"""
|
||||||
from reflex.utils.exceptions import ReflexRuntimeError
|
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
|
# Render a default 404 page if the user didn't supply one
|
||||||
if constants.Page404.SLUG not in self.pages:
|
if constants.Page404.SLUG not in self.pages:
|
||||||
self.add_custom_404_page()
|
self.add_custom_404_page()
|
||||||
@ -861,7 +865,7 @@ class App(LifespanMixin, Base):
|
|||||||
fixed_pages_within_executor = 5
|
fixed_pages_within_executor = 5
|
||||||
progress.start()
|
progress.start()
|
||||||
task = progress.add_task(
|
task = progress.add_task(
|
||||||
"Compiling:",
|
f"[{get_compilation_time()}] Compiling:",
|
||||||
total=len(self.pages)
|
total=len(self.pages)
|
||||||
+ fixed_pages_within_executor
|
+ fixed_pages_within_executor
|
||||||
+ adhoc_steps_without_executor,
|
+ adhoc_steps_without_executor,
|
||||||
|
Loading…
Reference in New Issue
Block a user