Skip to content

Commit

Permalink
Optimize filter order
Browse files Browse the repository at this point in the history
  • Loading branch information
cl-bvl committed Jan 25, 2024
1 parent a621c7f commit 3ad83b9
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 29 deletions.
1 change: 0 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ builds:
- arm
- arm64
goarm:
- 6
- 7
archives:
- id: s3sync
Expand Down
56 changes: 28 additions & 28 deletions cli/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,34 @@ func setupPipeline(syncGroup *pipeline.Group, cli *argsParsed) {
})
}

if cli.FilterDirs {
syncGroup.AddPipeStep(pipeline.Step{
Name: "FilterObjectsDirs",
Fn: collection.FilterObjectsDirs,
})
}

if cli.FilterDirsNot {
syncGroup.AddPipeStep(pipeline.Step{
Name: "FilterObjectsDirsNot",
Fn: collection.FilterObjectsDirsNot,
})
}

if cli.FilterExist {
syncGroup.AddPipeStep(pipeline.Step{
Name: "FilterObjectsExist",
Fn: collection.FilterObjectsExist,
})
}

if cli.FilterExistNot {
syncGroup.AddPipeStep(pipeline.Step{
Name: "FilterObjectsExistNot",
Fn: collection.FilterObjectsExistNot,
})
}

loadObjMetaStep := pipeline.Step{
Name: "LoadObjMeta",
Fn: collection.LoadObjectMeta,
Expand Down Expand Up @@ -129,20 +157,6 @@ func setupPipeline(syncGroup *pipeline.Group, cli *argsParsed) {
})
}

if cli.FilterDirs {
syncGroup.AddPipeStep(pipeline.Step{
Name: "FilterObjectsDirs",
Fn: collection.FilterObjectsDirs,
})
}

if cli.FilterDirsNot {
syncGroup.AddPipeStep(pipeline.Step{
Name: "FilterObjectsDirsNot",
Fn: collection.FilterObjectsDirsNot,
})
}

if len(cli.FilterCT) > 0 {
syncGroup.AddPipeStep(pipeline.Step{
Name: "FilterObjByCT",
Expand All @@ -166,20 +180,6 @@ func setupPipeline(syncGroup *pipeline.Group, cli *argsParsed) {
})
}

if cli.FilterExist {
syncGroup.AddPipeStep(pipeline.Step{
Name: "FilterObjectsExist",
Fn: collection.FilterObjectsExist,
})
}

if cli.FilterExistNot {
syncGroup.AddPipeStep(pipeline.Step{
Name: "FilterObjectsExistNot",
Fn: collection.FilterObjectsExistNot,
})
}

syncGroup.AddPipeStep(pipeline.Step{
Name: "LoadObjData",
Fn: collection.LoadObjectData,
Expand Down

0 comments on commit 3ad83b9

Please sign in to comment.