From d6e365bb4235d7a7656a2f3bac7f66aa141cb7b1 Mon Sep 17 00:00:00 2001 From: Herman Schaaf Date: Mon, 10 Oct 2022 14:47:50 +0100 Subject: [PATCH 1/2] Make concurrency change backwards-compatible --- specs/source.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/specs/source.go b/specs/source.go index 0aaf93f1b2..29dde59481 100644 --- a/specs/source.go +++ b/specs/source.go @@ -26,6 +26,7 @@ type Source struct { Path string `json:"path,omitempty"` // Registry can be github,local,grpc. Registry Registry `json:"registry,omitempty"` + Concurrency uint64 `json:"concurrency,omitempty"` // deprecated: use TableConcurrency and ResourceConcurrency instead TableConcurrency uint64 `json:"table_concurrency,omitempty"` ResourceConcurrency uint64 `json:"resource_concurrency,omitempty"` // Tables to sync from the source plugin @@ -53,6 +54,12 @@ func (s *Source) SetDefaults() { s.Tables = []string{"*"} } + if s.Concurrency != 0 { + // attempt to make a sensible backwards-compatible choice, but the CLI + // should raise a warning about this until concurrency is fully removed. + s.TableConcurrency = s.Concurrency + s.ResourceConcurrency = s.Concurrency + } if s.TableConcurrency == 0 { s.TableConcurrency = defaultTableConcurrency } From e8849cd8fc005a240e3bc9d33f950086d2644afa Mon Sep 17 00:00:00 2001 From: Herman Schaaf Date: Mon, 10 Oct 2022 14:53:51 +0100 Subject: [PATCH 2/2] Update --- specs/source.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specs/source.go b/specs/source.go index 29dde59481..3d39f8e3bf 100644 --- a/specs/source.go +++ b/specs/source.go @@ -54,9 +54,9 @@ func (s *Source) SetDefaults() { s.Tables = []string{"*"} } - if s.Concurrency != 0 { + if s.Concurrency != 0 && s.TableConcurrency == 0 && s.ResourceConcurrency == 0 { // attempt to make a sensible backwards-compatible choice, but the CLI - // should raise a warning about this until concurrency is fully removed. + // should raise a warning about this until the `concurrency` option is fully removed. s.TableConcurrency = s.Concurrency s.ResourceConcurrency = s.Concurrency }