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

alexstocks pushed a commit to branch 3.0
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git


The following commit(s) were added to refs/heads/3.0 by this push:
     new 3a1b260  performance optimization: change time.After => time.NewTimer 
for 3.0 (#1300)
3a1b260 is described below

commit 3a1b26088311e6f575b52ab67d942470643b5a63
Author: Mark4z <[email protected]>
AuthorDate: Mon Jul 5 19:08:17 2021 +0800

    performance optimization: change time.After => time.NewTimer for 3.0 (#1300)
    
    * build(deps): bump actions/cache from v2.1.4 to v2.1.5
    
    Bumps [actions/cache](https://github.com/actions/cache) from v2.1.4 to 
v2.1.5.
    - [Release notes](https://github.com/actions/cache/releases)
    - 
[Commits](https://github.com/actions/cache/compare/v2.1.4...1a9e2138d905efd099035b49d8b7a3888c653ca8)
    
    Signed-off-by: dependabot[bot] <[email protected]>
    
    * improve etcd version and change create to put (#1203)
    
    * make the package v3router/judger test coverage rate reach 80% (#1260)
    
    * make the package v3router/judger test coverage rate reach 80%
    
    * add router_chain unit test
    
    * refactor imports and some code
    
    * remove blank lines
    
    Co-authored-by: dongjianhui <[email protected]>
    
    * Fix: Graceful shutdown bugs(supplement #1254) (#1257)
    
    * supplementary fix #1254
    
    remove unused comments
    
    fix import cycle
    
    append apache license header
    
    fix gracefulShutdownFilter unittest bug
    
    go fmt
    
    fix gracefulShutdownConfig unittest bug
    
    fix gracefulShutdownConfig unittest bug
    
    go fmt
    
    * improve formatting based on code style
    
    * go fmt
    
    * set RequestsFinished explicitly
    
    * use mutex to protect variables of ShutdownConfig
    
    * ftr: add config (#1258)
    
    * recover gracefulShutdownFilter logic
    
    * remove unused mutex
    
    Co-authored-by: Laurence 
<[email protected]>
    
    * refine grpc test code (#1266)
    
    * refine grpc test code
    
    * fix test
    
    * remove useless code
    
    * config test grpc server
    
    * registry 默认值问题 (#1275)
    
    Co-authored-by: wangxiaowei14227 <[email protected]>
    
    * config center for more parameters (#1277)
    
    * nacos config center optimize
    
    * up remote config
    
    * add protocol chick
    
    * up:代码优化
    
    * go fmt
    
    * fix: add arch picture in readme and delete unused router field. (#1279)
    
    * fix
    
    * fix: delete notify
    
    * performance optimization: change time.After => time.NewTimer
    
    Co-authored-by: dependabot[bot] 
<49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: Xin.Zh <[email protected]>
    Co-authored-by: AlexStocks <[email protected]>
    Co-authored-by: randy <[email protected]>
    Co-authored-by: LaurenceLiZhixin <[email protected]>
    Co-authored-by: Mulavar <[email protected]>
    Co-authored-by: dongjianhui <[email protected]>
    Co-authored-by: XavierNiu <[email protected]>
    Co-authored-by: Laurence 
<[email protected]>
    Co-authored-by: gaoxinge <[email protected]>
    Co-authored-by: wangxw666 <[email protected]>
    Co-authored-by: wangxiaowei14227 <[email protected]>
    Co-authored-by: 赵云兴 <[email protected]>
---
 protocol/grpc/server.go | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/protocol/grpc/server.go b/protocol/grpc/server.go
index 3466232..e068999 100644
--- a/protocol/grpc/server.go
+++ b/protocol/grpc/server.go
@@ -119,7 +119,8 @@ func waitGrpcExporter(providerServices 
map[string]*config.ServiceConfig) {
        t := time.NewTicker(50 * time.Millisecond)
        defer t.Stop()
        pLen := len(providerServices)
-       ta := time.After(10 * time.Second)
+       ta := time.NewTimer(10 * time.Second)
+       defer ta.Stop()
 
        for {
                select {
@@ -128,7 +129,7 @@ func waitGrpcExporter(providerServices 
map[string]*config.ServiceConfig) {
                        if pLen == mLen {
                                return
                        }
-               case <-ta:
+               case <-ta.C:
                        panic("wait grpc exporter timeout when start grpc 
server")
                }
        }

Reply via email to