From c2e208c9d42b5f170cf697c1c0b89cc1019aa0e2 Mon Sep 17 00:00:00 2001 From: Samar Abbas Date: Tue, 27 Feb 2018 13:38:17 -0800 Subject: [PATCH] remove test code --- service/worker/replicator.go | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/service/worker/replicator.go b/service/worker/replicator.go index cf225b0417b..aa2f61c8ef2 100644 --- a/service/worker/replicator.go +++ b/service/worker/replicator.go @@ -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" @@ -74,8 +73,6 @@ func (r *Replicator) Start() error { } } - r.sendTestMessages() - return nil } @@ -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) - } - } - } - } -}