Skip to content
Snippets Groups Projects
Commit 8a0ca9c9 authored by LaurenceLiZhixin's avatar LaurenceLiZhixin
Browse files

fix: fix ci

parent c88ad275
No related branches found
No related tags found
No related merge requests found
......@@ -13,7 +13,7 @@ require (
github.com/creasty/defaults v1.5.1
github.com/dubbogo/go-zookeeper v1.0.2
github.com/dubbogo/gost v1.11.0
github.com/dubbogo/triple v0.0.0-20210318020559-4db55a5388a2
github.com/dubbogo/triple v0.0.0-20210318081906-6fdf7ced4828
github.com/emicklei/go-restful/v3 v3.4.0
github.com/fsnotify/fsnotify v1.4.9
github.com/go-co-op/gocron v0.1.1
......
......@@ -257,6 +257,8 @@ github.com/dubbogo/triple v0.0.0-20210314060249-a8daea612f94 h1:njPcvq1+x/RMMKjE
github.com/dubbogo/triple v0.0.0-20210314060249-a8daea612f94/go.mod h1:/jrqKfnQRjI91dFT3cgUuDkG3AuFPTTMOya6RdCiVcE=
github.com/dubbogo/triple v0.0.0-20210318020559-4db55a5388a2 h1:1kHGnzCr5E97Y9fW0G2jg4yXktAe1l0zo2aUthR5gvI=
github.com/dubbogo/triple v0.0.0-20210318020559-4db55a5388a2/go.mod h1:xNXaE2KrRrZfHSaS6ipvMyREzV/LyGeHdjXa9wbTS7Y=
github.com/dubbogo/triple v0.0.0-20210318081906-6fdf7ced4828 h1:/jmL2E+kPB3MY8cK77lUHfDq0zBuTtP5Hn4tA8Uqb2o=
github.com/dubbogo/triple v0.0.0-20210318081906-6fdf7ced4828/go.mod h1:LQDA+Bcob67J7qTEVjotf0+sSFiNUwFNDycWmUZk1w8=
github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
......
......@@ -52,8 +52,8 @@ var (
type DubboProtocol struct {
protocol.BaseProtocol
serverLock sync.Mutex
serviceMap *sync.Map // is used to export multiple service by one server
serverMap map[string]*triple.TripleServer // It is store relationship about serviceKey(group/interface:version) and ExchangeServer
serviceMap *sync.Map // serviceMap is used to export multiple service by one server
serverMap map[string]*triple.TripleServer // serverMap stores all exported server
}
// NewDubboProtocol create a dubbo protocol.
......@@ -112,10 +112,16 @@ func (dp *DubboProtocol) Refer(url *common.URL) protocol.Invoker {
func (dp *DubboProtocol) Destroy() {
dp.BaseProtocol.Destroy()
// stop server
for key, server := range dp.serverMap {
delete(dp.serverMap, key)
server.Stop()
dp.serverLock.Lock()
defer dp.serverLock.Unlock()
// Stop all server
keyList := make([]string, 16)
for k, _ := range dp.serverMap {
keyList = append(keyList, k)
}
for _, v := range keyList {
dp.serverMap[v].Stop()
delete(dp.serverMap, v)
}
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment