Skip to content

Commit ba19b89

Browse files
committed
use defer to unlock
1 parent 8821811 commit ba19b89

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/store/storepb/inprocess.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ func newInProcessClient(ctx context.Context, next func() (*SeriesResponse, error
5353

5454
func (c *inProcessClient) Recv() (*SeriesResponse, error) {
5555
c.mu.Lock()
56+
defer c.mu.Unlock()
5657
resp, err, ok := c.next()
57-
c.mu.Unlock()
5858
if err != nil {
5959
c.stop()
6060
return nil, err
@@ -74,8 +74,8 @@ func (c *inProcessClient) Context() context.Context {
7474

7575
func (c *inProcessClient) CloseSend() error {
7676
c.mu.Lock()
77+
defer c.mu.Unlock()
7778
c.stop()
78-
c.mu.Unlock()
7979
return nil
8080
}
8181

0 commit comments

Comments
 (0)