Skip to content

Commit

Permalink
fix: use defer for unlock (influxdata#22929)
Browse files Browse the repository at this point in the history
  • Loading branch information
lesam authored and chengshiwen committed Aug 11, 2024
1 parent ed80518 commit 043fb73
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions services/meta/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -929,15 +929,14 @@ func (c *Client) DropSubscription(database, rp, name string) error {
// SetData overwrites the underlying data in the meta store.
func (c *Client) SetData(data *Data) error {
c.mu.Lock()
defer c.mu.Unlock()

d := data.Clone()

if err := c.commit(d); err != nil {
return err
}

c.mu.Unlock()

return nil
}

Expand Down

0 comments on commit 043fb73

Please sign in to comment.