|
@@ -78,28 +78,15 @@ const (
|
|
|
|
|
|
|
|
// Track sends the tracking analytics to Docker Desktop
|
|
// Track sends the tracking analytics to Docker Desktop
|
|
|
func Track(context string, args []string, flags *flag.FlagSet) {
|
|
func Track(context string, args []string, flags *flag.FlagSet) {
|
|
|
- wasIn := make(chan bool)
|
|
|
|
|
-
|
|
|
|
|
- // Fire and forget, we don't want to slow down the user waiting for DD
|
|
|
|
|
- // metrics endpoint to respond. We could lose some events but that's ok.
|
|
|
|
|
- go func() {
|
|
|
|
|
- defer func() {
|
|
|
|
|
- _ = recover()
|
|
|
|
|
- }()
|
|
|
|
|
-
|
|
|
|
|
- wasIn <- true
|
|
|
|
|
-
|
|
|
|
|
- command := getCommand(args, flags)
|
|
|
|
|
- if command != "" {
|
|
|
|
|
- c := NewClient()
|
|
|
|
|
- c.Send(Command{
|
|
|
|
|
- Command: command,
|
|
|
|
|
- Context: context,
|
|
|
|
|
- Source: CLISource,
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
- }()
|
|
|
|
|
- <-wasIn
|
|
|
|
|
|
|
+ command := getCommand(args, flags)
|
|
|
|
|
+ if command != "" {
|
|
|
|
|
+ c := NewClient()
|
|
|
|
|
+ c.Send(Command{
|
|
|
|
|
+ Command: command,
|
|
|
|
|
+ Context: context,
|
|
|
|
|
+ Source: CLISource,
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
func getCommand(args []string, flags *flag.FlagSet) string {
|
|
func getCommand(args []string, flags *flag.FlagSet) string {
|