| 219 | } |
| 220 | |
| 221 | func (d *naiveNotify) shouldNotify(path string) bool { |
| 222 | if _, ok := d.notifyList[path]; ok { |
| 223 | // We generally don't care when directories change at the root of an ADD |
| 224 | stat, err := os.Lstat(path) |
| 225 | isDir := err == nil && stat.IsDir() |
| 226 | return !isDir |
| 227 | } |
| 228 | |
| 229 | for root := range d.notifyList { |
| 230 | if pathutil.IsChild(root, path) { |
| 231 | return true |
| 232 | } |
| 233 | } |
| 234 | return false |
| 235 | } |
| 236 | |
| 237 | func (d *naiveNotify) shouldSkipDir(path string) bool { |
| 238 | // If path is directly in the notifyList, we should always watch it. |