Skip to content

Commit

Permalink
Replace switch with if
Browse files Browse the repository at this point in the history
  • Loading branch information
animesh2049 authored and Arijit Das committed Mar 23, 2020
1 parent 0114358 commit 1c83402
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
7 changes: 3 additions & 4 deletions worker/background_mutation.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,12 @@ func (e *executor) processMutationCh(ch chan *subMutation) {
for _, edge := range payload.edges {
for {
err := runMutation(payload.ctx, edge, ptxn)
switch {
case err == nil:
if err == nil {
break
case err != posting.ErrRetry:
}
if err != posting.ErrRetry {
glog.Errorf("Error while mutating: %v", err)
break
default:
}
}
}
Expand Down
9 changes: 3 additions & 6 deletions worker/draft.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,9 @@ func newNode(store *raftwal.DiskStorage, gid uint32, id uint64, myAddr string) *
// We need a generous size for applyCh, because raft.Tick happens every
// 10ms. If we restrict the size here, then Raft goes into a loop trying
// to maintain quorum health.
applyCh: make(chan []*pb.Proposal, 1000),
rollupCh: make(chan uint64, 3),
proposalCh: make(chan batch, num),
commitCh: make(chan commitBatch, num*20),
elog: trace.NewEventLog("Dgraph", "ApplyCh"),
closer: y.NewCloser(3), // Matches CLOSER:1
applyCh: make(chan []*pb.Proposal, 1000),
elog: trace.NewEventLog("Dgraph", "ApplyCh"),
closer: y.NewCloser(3), // Matches CLOSER:1
}
if x.WorkerConfig.LudicrousMode {
n.ex = newExecutor()
Expand Down

0 comments on commit 1c83402

Please sign in to comment.