Skip to content

Commit

Permalink
change(syncer): add --no-dedupe command to bypass dedupes for all syn…
Browse files Browse the repository at this point in the history
…cers
  • Loading branch information
l3uddz committed May 17, 2020
1 parent dedbc9c commit b2a486a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
var (
flagSyncer string
flagParallelism int
flagNoDedupe bool
)

var syncCmd = &cobra.Command{
Expand Down Expand Up @@ -106,6 +107,8 @@ func init() {

syncCmd.Flags().StringVarP(&flagSyncer, "syncer", "s", "", "Run for a specific syncer")
syncCmd.Flags().IntVarP(&flagParallelism, "parallelism", "p", 1, "Max parallel syncers")

syncCmd.Flags().BoolVar(&flagNoDedupe, "no-dedupe", false, "Ignore dedupe tasks for syncer")
}

func worker(wg *sync.WaitGroup, jobs <-chan *syncer.Syncer) {
Expand Down Expand Up @@ -169,7 +172,7 @@ func performSync(s *syncer.Syncer) error {
}

/* Dedupe */
if len(s.Config.Remotes.Dedupe) > 0 {
if !flagNoDedupe && len(s.Config.Remotes.Dedupe) > 0 {
s.Log.Info("Running dedupes...")

if err := s.Dedupe(nil); err != nil {
Expand Down

0 comments on commit b2a486a

Please sign in to comment.