Skip to content

Commit

Permalink
move the mutex and change from RLock to Lock
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisfoster121 committed Sep 10, 2024
1 parent 6684427 commit 980fcd0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/sdkserver/sdkserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -1079,15 +1079,15 @@ func (s *SDKServer) UpdateList(ctx context.Context, in *beta.UpdateListRequest)
return nil, errors.Errorf("out of range. Capacity must be within range [0,1000]. Found Capacity: %d", in.List.Capacity)
}

s.gsUpdateMutex.RLock()
defer s.gsUpdateMutex.RUnlock()

list, err := s.GetList(ctx, &beta.GetListRequest{Name: in.List.Name})
if err != nil {

return nil, errors.Errorf("not found. %s List not found", list.Name)
}

s.gsUpdateMutex.Lock()
defer s.gsUpdateMutex.Unlock()

// Removes any fields from the request object that are not included in the FieldMask Paths.
fmutils.Filter(in.List, in.UpdateMask.Paths)

Expand Down

0 comments on commit 980fcd0

Please sign in to comment.