mirror of
https://github.com/minio/minio.git
synced 2025-01-23 20:53:18 -05:00
use readlock instead of writelock to get heal information (#16175)
This commit is contained in:
parent
44735be38e
commit
8d8d07ac5c
@ -222,8 +222,8 @@ func (ahs *allHealState) periodicHealSeqsClean(ctx context.Context) {
|
|||||||
// getHealSequenceByToken - Retrieve a heal sequence by token. The second
|
// getHealSequenceByToken - Retrieve a heal sequence by token. The second
|
||||||
// argument returns if a heal sequence actually exists.
|
// argument returns if a heal sequence actually exists.
|
||||||
func (ahs *allHealState) getHealSequenceByToken(token string) (h *healSequence, exists bool) {
|
func (ahs *allHealState) getHealSequenceByToken(token string) (h *healSequence, exists bool) {
|
||||||
ahs.Lock()
|
ahs.RLock()
|
||||||
defer ahs.Unlock()
|
defer ahs.RUnlock()
|
||||||
for _, healSeq := range ahs.healSeqMap {
|
for _, healSeq := range ahs.healSeqMap {
|
||||||
if healSeq.clientToken == token {
|
if healSeq.clientToken == token {
|
||||||
return healSeq, true
|
return healSeq, true
|
||||||
@ -235,8 +235,8 @@ func (ahs *allHealState) getHealSequenceByToken(token string) (h *healSequence,
|
|||||||
// getHealSequence - Retrieve a heal sequence by path. The second
|
// getHealSequence - Retrieve a heal sequence by path. The second
|
||||||
// argument returns if a heal sequence actually exists.
|
// argument returns if a heal sequence actually exists.
|
||||||
func (ahs *allHealState) getHealSequence(path string) (h *healSequence, exists bool) {
|
func (ahs *allHealState) getHealSequence(path string) (h *healSequence, exists bool) {
|
||||||
ahs.Lock()
|
ahs.RLock()
|
||||||
defer ahs.Unlock()
|
defer ahs.RUnlock()
|
||||||
h, exists = ahs.healSeqMap[path]
|
h, exists = ahs.healSeqMap[path]
|
||||||
return h, exists
|
return h, exists
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user