Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
Signed-off-by: Dirkjan Bussink <[email protected]>
  • Loading branch information
dbussink committed May 14, 2024
1 parent 69b352d commit cf32fe9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions go/cmd/vtgate/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ func run(cmd *cobra.Command, args []string) error {

servenv.Init()

// Ensure we open the topo before we start the context, so that the
// defer that closes the topo runs after cancelling the context.
// This ensures that we've properly closed things like the watchers
// at that point.
ts := topo.Open()
defer ts.Close()

Expand Down
4 changes: 4 additions & 0 deletions go/cmd/vttablet/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ func init() {
func run(cmd *cobra.Command, args []string) error {
servenv.Init()

// Ensure we open the topo before we start the context, so that the
// defer that closes the topo runs after cancelling the context.
// This ensures that we've properly closed things like the watchers
// at that point.
ts := topo.Open()
defer ts.Close()

Expand Down

0 comments on commit cf32fe9

Please sign in to comment.