Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 28 additions & 4 deletions pb/c1/connector/v2/resource.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pb/c1/connector/v2/resource.pb.validate.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 22 additions & 2 deletions pb/c1/connector/v2/resource_protoopaque.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions pkg/cli/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,10 @@ func MakeMainCommand[T field.Configurable](
}
}

if v.GetBool("parallel-sync") {
opts = append(opts, connectorrunner.WithParallelSyncEnabled())
}

if v.GetString("c1z-temp-dir") != "" {
c1zTmpDir := v.GetString("c1z-temp-dir")
if _, err := os.Stat(c1zTmpDir); os.IsNotExist(err) {
Expand Down
13 changes: 12 additions & 1 deletion pkg/connectorrunner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ type runnerConfig struct {
syncDifferConfig *syncDifferConfig
syncCompactorConfig *syncCompactorConfig
skipFullSync bool
parallelSync bool
targetedSyncResourceIDs []string
externalResourceC1Z string
externalResourceEntitlementIdFilter string
Expand Down Expand Up @@ -552,6 +553,13 @@ func WithFullSyncDisabled() Option {
}
}

func WithParallelSyncEnabled() Option {
return func(ctx context.Context, cfg *runnerConfig) error {
cfg.parallelSync = true
return nil
}
}

func WithTargetedSyncResourceIDs(resourceIDs []string) Option {
return func(ctx context.Context, cfg *runnerConfig) error {
cfg.targetedSyncResourceIDs = resourceIDs
Expand Down Expand Up @@ -803,6 +811,7 @@ func NewConnectorRunner(ctx context.Context, c types.ConnectorServer, opts ...Op
local.WithSkipEntitlementsAndGrants(cfg.skipEntitlementsAndGrants),
local.WithSkipGrants(cfg.skipGrants),
local.WithSyncResourceTypeIDs(cfg.syncResourceTypeIDs),
local.WithParallelSyncEnabled(cfg.parallelSync),
)
if err != nil {
return nil, err
Expand All @@ -815,7 +824,8 @@ func NewConnectorRunner(ctx context.Context, c types.ConnectorServer, opts ...Op
return runner, nil
}

tm, err := c1api.NewC1TaskManager(ctx,
tm, err := c1api.NewC1TaskManager(
ctx,
cfg.clientID,
cfg.clientSecret,
cfg.tempDir,
Expand All @@ -824,6 +834,7 @@ func NewConnectorRunner(ctx context.Context, c types.ConnectorServer, opts ...Op
cfg.externalResourceEntitlementIdFilter,
cfg.targetedSyncResourceIDs,
cfg.syncResourceTypeIDs,
cfg.parallelSync,
)
if err != nil {
return nil, err
Expand Down
Loading
Loading