flow-cli
flow-cli copied to clipboard
Refactor metric preference setting
The CLI is getting rate-limited when requesting the user preference from the mixpanel. We need to refactor the way this works so we don't send all those requests. We could keep opt-in behavior and only disable sending of requests if the value is set in a configuration file we add. The configuration file would be added once a user chooses to opt out and we should also let the user know we will create that file for them and that if they switch the operating system they need to again disable this setting. That file should be saved somewhere in a users home directory (~/.config
), the file should be named something like .flow-cli.config
and it should contain JSON with values (currently only the metrics: "disabled/enabled"). We should completely remove the part where we check for those values from mixpanel.
The submission of command usage to mixpanel should also be done concurrently on a separate go routine.