refactor: Renamed .anonymous_id file to anon_id
Renamed .anonymous_id file to anon_id Refactor #COG-492
This commit is contained in:
parent
9277363c24
commit
33c3748d1e
2 changed files with 3 additions and 1 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -177,5 +177,6 @@ cognee/cache/
|
||||||
# Default cognee system directory, used in development
|
# Default cognee system directory, used in development
|
||||||
.cognee_system/
|
.cognee_system/
|
||||||
.data_storage/
|
.data_storage/
|
||||||
|
.anon_id
|
||||||
|
|
||||||
node_modules/
|
node_modules/
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ def get_anonymous_id():
|
||||||
|
|
||||||
if not os.path.isdir(home_dir):
|
if not os.path.isdir(home_dir):
|
||||||
os.makedirs(home_dir, exist_ok=True)
|
os.makedirs(home_dir, exist_ok=True)
|
||||||
anonymous_id_file = os.path.join(home_dir, ".anonymous_id")
|
anonymous_id_file = os.path.join(home_dir, ".anon_id")
|
||||||
if not os.path.isfile(anonymous_id_file):
|
if not os.path.isfile(anonymous_id_file):
|
||||||
anonymous_id = str(uuid4())
|
anonymous_id = str(uuid4())
|
||||||
with open(anonymous_id_file, "w", encoding="utf-8") as f:
|
with open(anonymous_id_file, "w", encoding="utf-8") as f:
|
||||||
|
|
@ -52,6 +52,7 @@ def send_telemetry(event_name: str, user_id, additional_properties: dict = {}):
|
||||||
**additional_properties,
|
**additional_properties,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Needed to forward properties to PostHog along with id
|
||||||
posthog.identify(get_anonymous_id(), properties)
|
posthog.identify(get_anonymous_id(), properties)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue