Track the last reflex run time (#4045)

This commit is contained in:
Elijah Ahianyo 2024-10-03 16:48:50 +00:00 committed by GitHub
parent 3f51943162
commit 12d73e4167
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 0 deletions

View File

@ -237,6 +237,9 @@ def setup_frontend(
# Set the environment variables in client (env.json).
set_env_json()
# update the last reflex run time.
prerequisites.set_last_reflex_run_time()
# Disable the Next telemetry.
if disable_telemetry:
processes.new_process(

View File

@ -131,6 +131,14 @@ def get_or_set_last_reflex_version_check_datetime():
return last_version_check_datetime
def set_last_reflex_run_time():
"""Set the last Reflex run time."""
path_ops.update_json_file(
get_web_dir() / constants.Reflex.JSON,
{"last_reflex_run_datetime": str(datetime.now())},
)
def check_node_version() -> bool:
"""Check the version of Node.js.