mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 10:14:59 +00:00
fix: Handle Mixpanel connection errors by disabling tracking
This commit is contained in:
parent
baa13351a6
commit
12b789fc4e
1 changed files with 5 additions and 2 deletions
|
@ -5,7 +5,7 @@ import time
|
||||||
import uuid
|
import uuid
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from mixpanel import Mixpanel
|
from mixpanel import Mixpanel, MixpanelException
|
||||||
from posthog import Posthog
|
from posthog import Posthog
|
||||||
|
|
||||||
from aider import __version__
|
from aider import __version__
|
||||||
|
@ -182,7 +182,10 @@ class Analytics:
|
||||||
properties["aider_version"] = __version__
|
properties["aider_version"] = __version__
|
||||||
|
|
||||||
if self.mp:
|
if self.mp:
|
||||||
self.mp.track(self.user_id, event_name, dict(properties))
|
try:
|
||||||
|
self.mp.track(self.user_id, event_name, dict(properties))
|
||||||
|
except MixpanelException:
|
||||||
|
self.mp = None # Disable mixpanel on connection errors
|
||||||
|
|
||||||
if self.ph:
|
if self.ph:
|
||||||
self.ph.capture(self.user_id, event_name, dict(properties))
|
self.ph.capture(self.user_id, event_name, dict(properties))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue