Skip to content

Commit

Permalink
fix empty target issue
Browse files Browse the repository at this point in the history
  • Loading branch information
medcl committed May 14, 2020
1 parent b130105 commit 5ec4d73
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,20 @@ func main() {
showBar = false
}

if c.RepeatOutputTimes > 1 {
//至少输出一次
if c.RepeatOutputTimes < 1 {
c.RepeatOutputTimes=1
}else{
log.Info("source data will repeat send to target: ", c.RepeatOutputTimes, " times, the document id will be regenerated.")
}

if c.RepeatOutputTimes > 0 {

for i := 0; i <= c.RepeatOutputTimes; i++ {
fmt.Println("Round: ", i+1)

if c.RepeatOutputTimes>1 {
log.Info("repeat round: ", i+1)
}

// enough of a buffer to hold all the search results across all workers
migrator.DocChan = make(chan map[string]interface{}, c.DocBufferCount*c.Workers*10)
Expand Down Expand Up @@ -300,6 +310,7 @@ func main() {
if len(c.SourceEs) > 0 {
// get all indexes from source
indexNames, indexCount, sourceIndexMappings, err := migrator.SourceESAPI.GetIndexMappings(c.CopyAllIndexes, c.SourceIndexNames)

if err != nil {
log.Error(err)
return
Expand Down

0 comments on commit 5ec4d73

Please sign in to comment.