MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / GetTosAgreedTs

Function GetTosAgreedTs

pkg/telemetry/telemetry.go:34–49  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

32var cachedTosAgreedTs atomic.Int64
33
34func GetTosAgreedTs() int64 {
35 cached := cachedTosAgreedTs.Load()
36 if cached != 0 {
37 return cached
38 }
39
40 ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
41 defer cancel()
42 client, err := wstore.DBGetSingleton[*waveobj.Client](ctx)
43 if err != nil || client == nil || client.TosAgreed == 0 {
44 return 0
45 }
46
47 cachedTosAgreedTs.Store(client.TosAgreed)
48 return client.TosAgreed
49}
50
51type ActivityType struct {
52 Day string `json:"day"`

Callers 2

startupActivityUpdateFunction · 0.92
RecordTEventFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected