You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@eventmesh.apache.org by mi...@apache.org on 2023/06/27 11:11:51 UTC

[eventmesh-go] branch main updated: Update consumer_manager.go

This is an automated email from the ASF dual-hosted git repository.

mikexue pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/eventmesh-go.git


The following commit(s) were added to refs/heads/main by this push:
     new ef25910  Update consumer_manager.go
     new 387d9ee  Merge pull request #9 from harshithasudhakar/patch-3
ef25910 is described below

commit ef25910bf14661e905d5dfc9b776fe63c1b9c3d2
Author: Harshitha Sudhakar <11...@users.noreply.github.com>
AuthorDate: Mon Apr 24 10:34:54 2023 +0530

    Update consumer_manager.go
    
    Replaced time.Now().Sub() with time.Since()
---
 runtime/core/protocol/grpc/consumer/consumer_manager.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/runtime/core/protocol/grpc/consumer/consumer_manager.go b/runtime/core/protocol/grpc/consumer/consumer_manager.go
index c06f138..5cc8ffe 100644
--- a/runtime/core/protocol/grpc/consumer/consumer_manager.go
+++ b/runtime/core/protocol/grpc/consumer/consumer_manager.go
@@ -171,7 +171,7 @@ func (c *consumerManager) clientCheck() {
 				localClients := value.(*set.Set)
 				for iter := localClients.Begin(); iter.IsValid(); iter.Next() {
 					lc := iter.Value().(*GroupClient)
-					if time.Now().Sub(lc.LastUPTime) > sessionExpiredInMills {
+					if time.Since(lc.LastUPTime) > sessionExpiredInMills {
 						log.Warnf("client:%v lastUpdate time:%v over three heartbeat cycles. Removing it",
 							lc.ConsumerGroup, lc.LastUPTime)
 						emconsumer, err := c.GetConsumer(lc.ConsumerGroup)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: commits-help@eventmesh.apache.org