Skip to content

Commit

Permalink
remove test code
Browse files Browse the repository at this point in the history
  • Loading branch information
samarabbas committed Feb 27, 2018
1 parent c4b0521 commit c2e208c
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions service/worker/replicator.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ package worker
import (
"fmt"
"github.com/uber-common/bark"
"github.com/uber/cadence/.gen/go/replicator"
"github.com/uber/cadence/common/cluster"
"github.com/uber/cadence/common/logging"
"github.com/uber/cadence/common/messaging"
Expand Down Expand Up @@ -74,8 +73,6 @@ func (r *Replicator) Start() error {
}
}

r.sendTestMessages()

return nil
}

Expand All @@ -93,28 +90,3 @@ func getConsumerName(currentCluster, remoteCluster string) string {
func getTopicName(sourceCluster string) string {
return sourceCluster
}

func (r *Replicator) sendTestMessages() {
currentClusterName := r.metadata.GetCurrentClusterName()
for cluster := range r.metadata.GetAllClusterNames() {
if cluster != currentClusterName {
topicName := getTopicName(cluster)
producer, err := r.client.NewProducer(topicName)
if err != nil {
r.logger.Fatalf("Failed to create producer: %v", err)
}
defer producer.Close()

for i := 0; i < 10; i++ {
if err := producer.Publish(&replicator.ReplicationTask{
TaskType: replicator.ReplicationTaskTypeDomain.Ptr(),
DomainTaskAttributes: &replicator.DomainTaskAttributes{},
}); err != nil {
r.logger.Errorf("Error sending message to replicator. Error: %v", err)
} else {
r.logger.Infof("Msg '%v' successfully sent to replicator.", i)
}
}
}
}
}

0 comments on commit c2e208c

Please sign in to comment.