We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9eb386b commit f77cc32Copy full SHA for f77cc32
pkg/heartbeat/app.go
@@ -6,6 +6,7 @@ import (
6
"encoding/json"
7
"fmt"
8
"net/http"
9
+ "sync"
10
"time"
11
12
"github.com/pkg/errors"
@@ -19,6 +20,8 @@ import (
19
20
"k8s.io/client-go/kubernetes"
21
)
22
23
+var heartbeatMtx sync.Mutex
24
+
25
func SendAppHeartbeat(clientset kubernetes.Interface, sdkStore store.Store) error {
26
license := sdkStore.GetLicense()
27
@@ -30,6 +33,13 @@ func SendAppHeartbeat(clientset kubernetes.Interface, sdkStore store.Store) erro
30
33
return nil
31
34
}
32
35
36
+ // make sure events are reported in order
37
+ heartbeatMtx.Lock()
38
+ defer func() {
39
+ time.Sleep(1 * time.Second)
40
+ heartbeatMtx.Unlock()
41
+ }()
42
43
heartbeatInfo := GetHeartbeatInfo(sdkStore)
44
45
if util.IsAirgap() {
0 commit comments