Skip to content

Commit

Permalink
Refine the comments
Browse files Browse the repository at this point in the history
Signed-off-by: JmPotato <ghzpotato@gmail.com>
  • Loading branch information
JmPotato committed Apr 25, 2024
1 parent 97d995e commit 4eaa182
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions client/tso_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,9 +353,9 @@ func (c *tsoClient) tryConnectToTSO(
url string
cc *grpc.ClientConn
updateAndClear = func(newURL string, connectionCtx *tsoConnectionContext) {
// Only store the connectionCtx if it does not exist before.
// Only store the `connectionCtx` if it does not exist before.
connectionCtxs.LoadOrStore(newURL, connectionCtx)
// Remove all other connection contexts.
// Remove all other `connectionCtx`s.
connectionCtxs.Range(func(url, cc any) bool {
if url.(string) != newURL {
cc.(*tsoConnectionContext).cancel()
Expand Down
4 changes: 2 additions & 2 deletions client/tso_dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ func (c *tsoClient) updateTSODispatcher() {
}
if _, exist := c.GetTSOAllocators().Load(dcLocation); !exist {
log.Info("[tso] delete unused tso dispatcher", zap.String("dc-location", dcLocation))
dispatcher.(*tsoDispatcher).close()
c.tsoDispatcher.Delete(dcLocation)
dispatcher.(*tsoDispatcher).close()
}
return true
})
Expand Down Expand Up @@ -335,7 +335,7 @@ func (c *tsoClient) handleDispatcher(
tbc.clear()
c.wg.Done()
}()
// Daemon goroutine to update the connectionCtxs periodically and handle the TSO Follower Proxy switch event.
// Daemon goroutine to update the connectionCtxs periodically and handle the `connectionCtxs` update event.
go func() {
var updateTicker = &time.Ticker{}
setNewUpdateTicker := func(ticker *time.Ticker) {
Expand Down

0 comments on commit 4eaa182

Please sign in to comment.