Skip to content

Commit

Permalink
Track the last reflex run time (#4045)
Browse files Browse the repository at this point in the history
  • Loading branch information
ElijahAhianyo authored Oct 3, 2024
1 parent 3f51943 commit 12d73e4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions reflex/utils/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
8 changes: 8 additions & 0 deletions reflex/utils/prerequisites.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 12d73e4

Please sign in to comment.