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 2021/02/26 03:45:53 UTC

[GitHub] [servicecomb-service-center] robotLJW opened a new pull request #874: [SCB-2094] Bugfix-cache heartbeat mode in mongo

robotLJW opened a new pull request #874:
URL: https://github.com/apache/servicecomb-service-center/pull/874


   
   


----------------------------------------------------------------
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



[GitHub] [servicecomb-service-center] little-cui commented on a change in pull request #874: [SCB-2094] Bugfix-cache heartbeat mode in mongo

Posted by GitBox <gi...@apache.org>.
little-cui commented on a change in pull request #874:
URL: https://github.com/apache/servicecomb-service-center/pull/874#discussion_r583369936



##########
File path: datasource/mongo/mongo.go
##########
@@ -139,7 +141,7 @@ func EnsureInstance() {
 	wrapCreateCollectionError(err)
 
 	instanceIndex := BuildIndexDoc(ColumnRefreshTime)
-	instanceIndex.Options = options.Index().SetExpireAfterSeconds(60)
+	instanceIndex.Options = options.Index().SetExpireAfterSeconds(defaultExpireTime)

Review comment:
       自己实现了心跳,还需要这个索引吗?我建议把之前老的实现删掉,只保留sc自己维护心跳的逻辑

##########
File path: datasource/mongo/heartbeat/cache/heartbeatcache.go
##########
@@ -29,6 +29,11 @@ import (
 	"github.com/apache/servicecomb-service-center/pkg/util"
 )
 
+const (
+	defaultInterval = 60

Review comment:
       interval是30




----------------------------------------------------------------
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



[GitHub] [servicecomb-service-center] jasononion commented on a change in pull request #874: [SCB-2094] Bugfix-cache heartbeat mode in mongo

Posted by GitBox <gi...@apache.org>.
jasononion commented on a change in pull request #874:
URL: https://github.com/apache/servicecomb-service-center/pull/874#discussion_r583407670



##########
File path: datasource/mongo/heartbeat/cache/heartbeatcache.go
##########
@@ -91,6 +96,13 @@ func notInCacheStrategy(ctx context.Context, request *pb.HeartbeatRequest) (*pb.
 		return resp, err
 	}
 	interval, times := instance.Instance.HealthCheck.Interval, instance.Instance.HealthCheck.Times
+	// Set the range of interval and time
+	if interval > 60 || interval < 0 {

Review comment:
       60定义个常量




----------------------------------------------------------------
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



[GitHub] [servicecomb-service-center] tianxiaoliang merged pull request #874: [SCB-2094] Bugfix-cache heartbeat mode in mongo

Posted by GitBox <gi...@apache.org>.
tianxiaoliang merged pull request #874:
URL: https://github.com/apache/servicecomb-service-center/pull/874


   


----------------------------------------------------------------
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