Skip to content

Commit 8b42256

Browse files
fix(core): fix variables in live loader
1 parent 1193c84 commit 8b42256

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

dgraph/cmd/live/batch.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ type loader struct {
7777
conflicts map[uint64]struct{}
7878
uidsLock sync.RWMutex
7979

80-
reqNum uint64
8180
reqs chan *request
8281
zeroconn *grpc.ClientConn
8382
schema *Schema
@@ -161,6 +160,7 @@ func (l *loader) infinitelyRetry(req *request) {
161160

162161
func (l *loader) mutate(req *request) error {
163162
atomic.AddInt32(&l.inflight, 1)
163+
defer atomic.AddInt32(&l.inflight, -1)
164164
txn := l.dc.NewTxn()
165165
req.CommitNow = true
166166
request := &api.Request{
@@ -172,8 +172,6 @@ func (l *loader) mutate(req *request) error {
172172
}
173173

174174
func (l *loader) request(req *request) {
175-
atomic.AddUint64(&l.reqNum, 1)
176-
defer atomic.AddInt32(&l.inflight, -1)
177175
err := l.mutate(req)
178176
if err == nil {
179177
atomic.AddUint64(&l.nquads, uint64(len(req.Set)))

0 commit comments

Comments
 (0)