From 7bfbaaab2a8feca87ed65fbf0caea4526cda493e Mon Sep 17 00:00:00 2001 From: Fritz Larco Date: Wed, 16 Oct 2024 09:00:06 -0300 Subject: [PATCH] improve compile logic --- core/sling/replication.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core/sling/replication.go b/core/sling/replication.go index c76e0539..b8c7276d 100644 --- a/core/sling/replication.go +++ b/core/sling/replication.go @@ -377,6 +377,17 @@ func (rd *ReplicationConfig) ProcessWildcardsFile(c connection.Connection, patte // Compile compiles the replication into tasks func (rd *ReplicationConfig) Compile(cfgOverwrite *Config, selectStreams ...string) (err error) { if rd.Compiled { + // apply the selection if specified + if len(selectStreams) > 0 { + selectedTasks := []*Config{} + nameMap := g.ArrMapString(selectStreams) + for _, task := range rd.Tasks { + if _, ok := nameMap[task.StreamName]; ok { + selectedTasks = append(selectedTasks, task) + } + } + rd.Tasks = selectedTasks + } return nil }