tianxiaoliang commented on a change in pull request #941:
URL: 
https://github.com/apache/servicecomb-service-center/pull/941#discussion_r612220014



##########
File path: datasource/mongo/heartbeat/manager.go
##########
@@ -28,11 +29,14 @@ type healthCheckEngine func(opts Options) (HealthCheck, 
error)
 var (
        plugins             = make(map[ImplName]healthCheckEngine)
        healthCheckInstance HealthCheck
+       mu                  sync.RWMutex
 )
 
 // load plugins configuration into plugins
 func Install(pluginImplName string, engineFunc healthCheckEngine) {
+       mu.Lock()
        plugins[ImplName(pluginImplName)] = engineFunc

Review comment:
       defer




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to