This repository has been archived by the owner on Nov 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3636 from kingdonb/remove-telemetry
Remove telemetry
- Loading branch information
Showing
9 changed files
with
88 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package checkpoint | ||
|
||
import ( | ||
"sync" | ||
"time" | ||
) | ||
|
||
type flag struct { | ||
Key string | ||
Value string | ||
} | ||
|
||
type checkParams struct { | ||
Product string | ||
Version string | ||
Flags map[string]string | ||
ExtraFlags func() []flag | ||
Arch string | ||
OS string | ||
Signature string | ||
SignatureFile string | ||
CacheFile string | ||
CacheDuration time.Duration | ||
Force bool | ||
} | ||
|
||
type checker struct { | ||
doneCh chan struct{} | ||
nextCheckAt time.Time | ||
nextCheckAtLock sync.RWMutex | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package checkpoint | ||
|
||
import ( | ||
mrand "math/rand" | ||
"os" | ||
"time" | ||
) | ||
|
||
func isCheckDisabled() bool { | ||
return os.Getenv("CHECKPOINT_DISABLE") != "" | ||
} | ||
|
||
func randomStagger(interval time.Duration) time.Duration { | ||
stagger := time.Duration(mrand.Int63()) % (interval / 2) | ||
return 3*(interval/4) + stagger | ||
} |