Skip to content

Commit

Permalink
chore: temporarily remove analytics from being sent (#301)
Browse files Browse the repository at this point in the history
  • Loading branch information
hbagdi committed Apr 1, 2021
1 parent b8f5b8e commit 4717d53
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 66 deletions.
40 changes: 0 additions & 40 deletions cmd/analytics.go

This file was deleted.

27 changes: 2 additions & 25 deletions cmd/root.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package cmd

import (
"context"
"fmt"
"io/ioutil"
"net/url"
"os"
"strings"
"sync"

"github.com/fatih/color"
"github.com/kong/deck/utils"
Expand Down Expand Up @@ -43,29 +41,8 @@ It can be used to export, import or sync entities to Kong.`,
// Execute adds all child commands to the root command and sets
// sflags appropriately.
// This is called by main.main(). It only needs to happen once to the rootCmd.
func Execute() {
var wg sync.WaitGroup
var err error
const threads = 2
wg.Add(threads)

ctx, cancel := context.WithCancel(context.Background())

go func() {
defer wg.Done()
sendAnalytics(ctx)
}()

go func() {
defer wg.Done()
defer cancel()
err = rootCmd.Execute()
}()

wg.Wait()
if err != nil {
os.Exit(1)
}
func Execute() error {
return rootCmd.Execute()
}

//nolint:errcheck
Expand Down
6 changes: 5 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ func registerSignalHandler() {

func main() {
registerSignalHandler()
cmd.Execute()
err := cmd.Execute()
if err != nil {
fmt.Println(err)
os.Exit(1)
}
}

func init() {
Expand Down

0 comments on commit 4717d53

Please sign in to comment.