未验证 提交 84a538f4 编写于 作者: Z zhenshan.cao 提交者: GitHub

[skip ci]Fix golint error in allocator (#11045)

Signed-off-by: Nzhenshan.cao <zhenshan.cao@zilliz.com>
上级 32d9abff
......@@ -146,6 +146,7 @@ type Allocator struct {
Role string
}
// Start starts the loop of checking whether to synchronize with the global allocator.
func (ta *Allocator) Start() error {
ta.TChan.Init()
ta.wg.Add(1)
......@@ -153,6 +154,7 @@ func (ta *Allocator) Start() error {
return nil
}
// Init mainly initialize internal members.
func (ta *Allocator) Init() {
ta.ForceSyncChan = make(chan Request, maxConcurrentRequests)
ta.Reqs = make(chan Request, maxConcurrentRequests)
......@@ -281,6 +283,7 @@ func (ta *Allocator) revokeRequest(err error) {
}
}
// Close mainly stop the internal coroutine and recover resources.
func (ta *Allocator) Close() {
ta.CancelFunc()
ta.wg.Wait()
......@@ -289,6 +292,7 @@ func (ta *Allocator) Close() {
ta.revokeRequest(errors.New(errMsg))
}
// CleanCache is used to force synchronize with global allocator.
func (ta *Allocator) CleanCache() {
req := &SyncRequest{
BaseRequest: BaseRequest{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册