Skip to content

Commit b368593

Browse files
address reviews
1 parent 82c2d9f commit b368593

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

dgraph/cmd/live/batch.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,12 @@ func (l *loader) mutate(req *request) error {
168168
Mutations: []*api.Mutation{req.Mutation},
169169
}
170170
_, err := txn.Do(l.opts.Ctx, request)
171-
atomic.AddInt32(&l.inflight, -1)
172171
return err
173172
}
174173

175174
func (l *loader) request(req *request) {
176175
atomic.AddUint64(&l.reqNum, 1)
176+
defer atomic.AddInt32(&l.inflight, -1)
177177
err := l.mutate(req)
178178
if err == nil {
179179
atomic.AddUint64(&l.nquads, uint64(len(req.Set)))
@@ -421,12 +421,12 @@ func (l *loader) makeRequests() {
421421
t := time.NewTicker(5 * time.Second)
422422
defer t.Stop()
423423

424-
outer:
424+
loop:
425425
for {
426426
select {
427427
case req, ok := <-l.reqs:
428428
if !ok {
429-
break outer
429+
break loop
430430
}
431431
req.conflicts = l.conflictKeysForReq(req)
432432
if l.addConflictKeys(req) {

0 commit comments

Comments
 (0)