Skip to content

Commit 59ac17a

Browse files
authored
fix: Make concurrency change backwards-compatible (#271)
This makes #268 backwards-compatible with prior versions, as support for `concurrency` is retained for now.
1 parent e2acf4c commit 59ac17a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

specs/source.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ type Source struct {
2626
Path string `json:"path,omitempty"`
2727
// Registry can be github,local,grpc.
2828
Registry Registry `json:"registry,omitempty"`
29+
Concurrency uint64 `json:"concurrency,omitempty"` // deprecated: use TableConcurrency and ResourceConcurrency instead
2930
TableConcurrency uint64 `json:"table_concurrency,omitempty"`
3031
ResourceConcurrency uint64 `json:"resource_concurrency,omitempty"`
3132
// Tables to sync from the source plugin
@@ -53,6 +54,12 @@ func (s *Source) SetDefaults() {
5354
s.Tables = []string{"*"}
5455
}
5556

57+
if s.Concurrency != 0 && s.TableConcurrency == 0 && s.ResourceConcurrency == 0 {
58+
// attempt to make a sensible backwards-compatible choice, but the CLI
59+
// should raise a warning about this until the `concurrency` option is fully removed.
60+
s.TableConcurrency = s.Concurrency
61+
s.ResourceConcurrency = s.Concurrency
62+
}
5663
if s.TableConcurrency == 0 {
5764
s.TableConcurrency = defaultTableConcurrency
5865
}

0 commit comments

Comments
 (0)