Skip to content

Commit 62abebe

Browse files
author
akiraqb
committed
FFM-3677: adding thread protection + deleting duplicated line
1 parent 197466d commit 62abebe

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

client/client.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ func (c *CfClient) start() {
112112
go c.initAuthentication(ctx)
113113
go c.setAnalyticsServiceClient(ctx)
114114
go c.pullCronJob(ctx)
115-
go c.pullCronJob(ctx)
116115
}
117116

118117
// PostEvaluateProcessor push the data to the analytics service
@@ -394,6 +393,8 @@ func (c *CfClient) retrieveSegments(ctx context.Context) error {
394393
func (c *CfClient) setAnalyticsServiceClient(ctx context.Context) {
395394

396395
<-c.authenticated
396+
c.mux.RLock()
397+
defer c.mux.RUnlock()
397398
if !c.config.enableAnalytics {
398399
log.Println(time.Now().Format("2006-01-02 15:04:05") + " Posting analytics data disabled.")
399400
return

0 commit comments

Comments
 (0)