Skip to content
This repository has been archived by the owner on Feb 18, 2021. It is now read-only.

Commit

Permalink
minor update
Browse files Browse the repository at this point in the history
  • Loading branch information
datoug committed Jul 31, 2017
1 parent 5bf4ea2 commit 9607068
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions services/replicator/replicator.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,14 +253,15 @@ func (r *Replicator) OpenReplicationReadStreamHandler(w http.ResponseWriter, req
outConn := newOutConnection(extUUID, destDesc.GetPath(), outStream, r.logger, r.m3Client, metrics.OpenReplicationReadScope)
outConn.open()
r.addStoreHostConn(outConn)
defer r.removeStoreHostConn(outConn)

inConn := newInConnection(extUUID, destDesc.GetPath(), inStream, outConn.msgsCh, r.logger, r.m3Client, metrics.OpenReplicationReadScope, metrics.OpenReplicationReadPerDestScope)
inConn.open()

go r.manageInOutConn(inConn, outConn)
<-inConn.closeChannel
<-outConn.closeChannel
r.removeStoreHostConn(outConn)

return
}

Expand Down Expand Up @@ -333,14 +334,15 @@ func (r *Replicator) OpenReplicationRemoteReadStreamHandler(w http.ResponseWrite
outConn := newOutConnection(extUUID, destDesc.GetPath(), outStream, r.logger, r.m3Client, metrics.OpenReplicationRemoteReadScope)
outConn.open()
r.addRemoteReplicatorConn(outConn)
defer r.removeRemoteReplicatorConn(outConn)

inConn := newInConnection(extUUID, destDesc.GetPath(), inStream, outConn.msgsCh, r.logger, r.m3Client, metrics.OpenReplicationRemoteReadScope, metrics.OpenReplicationRemoteReadPerDestScope)
inConn.open()

go r.manageInOutConn(inConn, outConn)
<-inConn.closeChannel
<-outConn.closeChannel
r.removeRemoteReplicatorConn(outConn)

return
}

Expand Down

0 comments on commit 9607068

Please sign in to comment.