mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-02 02:34:59 +00:00
feat: Enhance analytics opt-in logic with user sampling and explicit control
This commit is contained in:
parent
3a28e74d89
commit
539a6cde63
4 changed files with 29 additions and 9 deletions
|
@ -62,8 +62,21 @@ class Analytics:
|
|||
self.permanently_disable = True
|
||||
self.save_data()
|
||||
|
||||
def need_to_ask(self):
|
||||
return not self.asked_opt_in and not self.permanently_disable
|
||||
def need_to_ask(self, args_analytics):
|
||||
if args_analytics is False:
|
||||
return False
|
||||
|
||||
could_ask = not self.asked_opt_in and not self.permanently_disable
|
||||
if not could_ask:
|
||||
return False
|
||||
|
||||
if args_analytics is True:
|
||||
return True
|
||||
|
||||
assert args_analytics is None, args_analytics
|
||||
|
||||
# ask 1/16 of the users
|
||||
return self.user_id < "1"
|
||||
|
||||
def get_data_file_path(self):
|
||||
data_file = Path.home() / ".aider" / "analytics.json"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue