Skip to content

Commit

Permalink
performance optimization: change time.After => time.NewTimer for 3.0 (#…
Browse files Browse the repository at this point in the history
…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](actions/cache@v2.1.4...1a9e213)

Signed-off-by: dependabot[bot] <support@github.com>

* 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 <dongjianhui@yuanfudao.com>

* 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 <45508533+LaurenceLiZhixin@users.noreply.github.com>

* refine grpc test code (#1266)

* refine grpc test code

* fix test

* remove useless code

* config test grpc server

* registry 默认值问题 (#1275)

Co-authored-by: wangxiaowei14227 <wangxiaowei14227@autohome.com.cn>

* 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 <dragoncharlie@foxmail.com>
Co-authored-by: AlexStocks <alexstocks@foxmail.com>
Co-authored-by: randy <ztelur@gmail.com>
Co-authored-by: LaurenceLiZhixin <382673304@qq.com>
Co-authored-by: Mulavar <978007503@qq.com>
Co-authored-by: dongjianhui <dongjianhui@yuanfudao.com>
Co-authored-by: XavierNiu <a@nxw.name>
Co-authored-by: Laurence <45508533+LaurenceLiZhixin@users.noreply.github.com>
Co-authored-by: gaoxinge <xg.gao@tianrang-inc.com>
Co-authored-by: wangxw666 <2484713618@qq.com>
Co-authored-by: wangxiaowei14227 <wangxiaowei14227@autohome.com.cn>
Co-authored-by: 赵云兴 <2385585770@qq.com>
  • Loading branch information
14 people committed Jul 5, 2021
1 parent 4e6c0e7 commit 3a1b260
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions protocol/grpc/server.go
Expand Up @@ -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 {
Expand All @@ -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")
}
}
Expand Down

0 comments on commit 3a1b260

Please sign in to comment.