Permalink
Browse files

magnaserv: improve change detection (update fsnotify, re-add after al…

…l events)
  • Loading branch information...
olt committed Aug 28, 2017
1 parent f162331 commit a09ecfb27a142ac2ec43c7d5bd01d20aaead7d01
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -59,4 +59,4 @@
[[constraint]]
name = "gopkg.in/fsnotify.v1"
version = "1.2.0"
version = "1.4.2"
View
@@ -183,18 +183,16 @@ func (c *Cache) Notify(mm MapMaker, mml string, mss []string, done <-chan struct
for {
select {
case evt := <-watcher.Events:
if evt.Op&fsnotify.Remove == fsnotify.Remove {
// atomic save of some editors will trigger remove event,
// which will remove the file from the watcher. add back again
watcher.Add(evt.Name)
}
style, err := c.style(mm, mml, mss)
if evt.Name == mml && len(mss) == 0 {
// update mms files to watch if mml changed and mss files were not set
if err := watchMSSFromMML(watcher, mml); err != nil {
updatec <- Update{Err: err}
}
}
style, err := c.style(mm, mml, mss)
// atomic save of some editors will trigger remove event,
// which will remove the file from the watcher. add back again
watcher.Add(evt.Name)
if err != nil {
updatec <- Update{Err: err}

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit a09ecfb

Please sign in to comment.