fix telemetry for init event (#2736)
This commit is contained in:
parent
39175f5812
commit
467fb794da
@ -94,13 +94,16 @@ def _init(
|
||||
template = prerequisites.prompt_for_template()
|
||||
prerequisites.create_config(app_name)
|
||||
prerequisites.initialize_app_directory(app_name, template)
|
||||
telemetry.send("init")
|
||||
telemetry_event = "init"
|
||||
else:
|
||||
telemetry.send("reinit")
|
||||
telemetry_event = "reinit"
|
||||
|
||||
# Set up the web project.
|
||||
prerequisites.initialize_frontend_dependencies()
|
||||
|
||||
# Send the telemetry event after the .web folder is initialized.
|
||||
telemetry.send(telemetry_event)
|
||||
|
||||
# Migrate Pynecone projects to Reflex.
|
||||
prerequisites.migrate_to_reflex()
|
||||
|
||||
|
@ -12,6 +12,8 @@ import psutil
|
||||
from reflex import constants
|
||||
from reflex.utils.prerequisites import ensure_reflex_installation_id
|
||||
|
||||
POSTHOG_API_URL: str = "https://app.posthog.com/capture/"
|
||||
|
||||
|
||||
def get_os() -> str:
|
||||
"""Get the operating system.
|
||||
@ -102,7 +104,7 @@ def send(event: str, telemetry_enabled: bool | None = None) -> bool:
|
||||
},
|
||||
"timestamp": datetime.utcnow().isoformat(),
|
||||
}
|
||||
httpx.post("https://app.posthog.com/capture/", json=post_hog)
|
||||
httpx.post(POSTHOG_API_URL, json=post_hog)
|
||||
return True
|
||||
except Exception:
|
||||
return False
|
||||
|
Loading…
Reference in New Issue
Block a user