You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2020/12/22 14:26:34 UTC

[GitHub] [servicecomb-service-center] jasononion commented on a change in pull request #789: Simple implementation of mongo cache for notify event to syncer

jasononion commented on a change in pull request #789:
URL: https://github.com/apache/servicecomb-service-center/pull/789#discussion_r547176271



##########
File path: datasource/mongo/mongo.go
##########
@@ -118,3 +121,12 @@ func (ds *DataSource) createIndexes() (err error) {
 	}
 	return
 }
+
+func (ds *DataSource) initStore() {
+	if !config.GetRegistry().EnableCache {
+		log.Debug("cache enable is false")

Review comment:
       cache is disabled

##########
File path: datasource/mongo/sd/typestore_test.go
##########
@@ -0,0 +1,43 @@
+package sd
+
+import (
+	"testing"
+
+	"github.com/stretchr/testify/assert"
+)
+
+func TestTypeStore_Initialize(t *testing.T) {
+	s := TypeStore{}
+	s.Initialize()
+	assert.NotNil(t, s.ready)
+	assert.NotNil(t, s.goroutine)
+	assert.Equal(t, false, s.isClose)
+}
+
+func TestTypeStore_Ready(t *testing.T) {
+	s := TypeStore{}
+	s.Initialize()
+	c := s.Ready()
+	assert.NotNil(t, c)
+	//s.Run()

Review comment:
       注释代码去掉

##########
File path: datasource/mongo/mongo.go
##########
@@ -23,6 +23,7 @@ import (
 	"github.com/apache/servicecomb-service-center/datasource"
 	"github.com/apache/servicecomb-service-center/datasource/mongo/client"
 	"github.com/apache/servicecomb-service-center/datasource/mongo/heartbeat"
+	"github.com/apache/servicecomb-service-center/datasource/mongo/sd"

Review comment:
       sd 的包名含义是?




----------------------------------------------------------------
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:
users@infra.apache.org