Skip to content

Commit

Permalink
ensure lock is obtained when getting values channel
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-garcia committed Aug 14, 2023
1 parent cf5d56b commit 6aeae4f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fsnotify/filewatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ package fsnotify

import (
"context"
rfsnotify "github.com/fsnotify/fsnotify"
"io/ioutil"
"log"
"net/url"
"strings"
"sync"
"time"

rfsnotify "github.com/fsnotify/fsnotify"
"github.com/infobloxopen/hotload"
)

Expand Down Expand Up @@ -98,8 +98,9 @@ func (s *Strategy) setVal(pth string, val string) {
s.mu.Lock()
defer s.mu.Unlock()
s.paths[pth].value = val
values := s.paths[pth].values
go func() {
s.paths[pth].values <- val
values <- val
}()
}

Expand Down

0 comments on commit 6aeae4f

Please sign in to comment.