Skip to content

Commit

Permalink
add posthog disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfeil committed Oct 10, 2024
1 parent 6ce0eb5 commit 6716258
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libs/infinity_emb/infinity_emb/telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,12 @@ def name(self):
class _PostHogCapture:
def __init__(self):
self._posthog = None

disabled = False
if not CHECK_POSTHOG.is_available or (not MANAGER.anonymous_usage_stats):
return
if "pytest" in sys.modules:
# disable posthog
disabled = True
posthog.disabled = True

try:
Expand All @@ -228,6 +229,7 @@ def __init__(self):
self._posthog = Posthog(
project_api_key=k,
host="https://eu.i.posthog.com",
disabled=disabled,
)

posthog_logger = logging.getLogger("posthog")
Expand Down

0 comments on commit 6716258

Please sign in to comment.