Skip to content

Commit

Permalink
STAC-21470: Fix duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
craffit committed Aug 21, 2024
1 parent 91ac414 commit b1e5a1b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion internal/mirror/reflector.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func (r *Reflector) AddMirrors(urls []string, persistent bool) {

for _, url := range urls {
log.Printf("Adding '%s' to mirror list.", url)
r.mirrors[url] = NewMirror(url, r.config, r.MirrorFailureChan, persistent, r.templateSendQueue)
r.mirrors[url] = NewMirror(url, r.config, r.MirrorFailureChan, persistent, r.templateSendQueue.Clone())
}
}

Expand Down
3 changes: 3 additions & 0 deletions internal/mirror/sendqueue.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ func MakeSendQueue(maxQueueSize int) *SendQueue {
}

func (s *SendQueue) Clone() *SendQueue {
s.Lock()
defer s.Unlock()

completedCopied := make(map[uint64]interface{}, 0)
for c, _ := range s.epochsCompleted {
completedCopied[c] = nil
Expand Down

0 comments on commit b1e5a1b

Please sign in to comment.