Skip to content

Commit

Permalink
rely on conn to enforce DefaultReadConcurrency
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
  • Loading branch information
timvaillancourt committed Nov 23, 2024
1 parent 4163176 commit 3d5023e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions go/vt/topo/keyspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,6 @@ func (ts *Server) FindAllShardsInKeyspace(ctx context.Context, keyspace string,
if opt == nil {
opt = &FindAllShardsInKeyspaceOptions{}
}
if opt.Concurrency <= 0 {
opt.Concurrency = DefaultReadConcurrency
}

// Unescape the keyspace name as this can e.g. come from the VSchema where
// a keyspace/database name will need to be SQL escaped if it has special
Expand Down Expand Up @@ -298,7 +295,9 @@ func (ts *Server) FindAllShardsInKeyspace(ctx context.Context, keyspace string,
)

eg, ctx := errgroup.WithContext(ctx)
eg.SetLimit(int(opt.Concurrency))
if opt.Concurrency > 0 {
eg.SetLimit(int(opt.Concurrency))
}

for _, shard := range shards {
shard := shard
Expand Down

0 comments on commit 3d5023e

Please sign in to comment.