Skip to content

Commit

Permalink
Refactor route group tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Darkren committed Jan 30, 2020
1 parent 58787e5 commit 46879d8
Show file tree
Hide file tree
Showing 2 changed files with 111 additions and 315 deletions.
4 changes: 1 addition & 3 deletions pkg/router/route_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,6 @@ func (rg *RouteGroup) Write(p []byte) (n int, err error) {
}

rg.mu.Lock()
//defer rg.mu.Unlock()

tp, err := rg.tp()
if err != nil {
rg.mu.Unlock()
Expand All @@ -207,7 +205,7 @@ func (rg *RouteGroup) Write(p []byte) (n int, err error) {
rg.mu.Unlock()
return 0, err
}

// we don't need to keep holding mutex from this point on
rg.mu.Unlock()

return rg.write(p, tp, rule)
Expand Down
Loading

0 comments on commit 46879d8

Please sign in to comment.