s.fileIndex needs to be locked before this function is called
(relativePath string, s *Sync)
| 8 | |
| 9 | // s.fileIndex needs to be locked before this function is called |
| 10 | func shouldRemoveRemote(relativePath string, s *Sync) bool { |
| 11 | // File / Folder was already deleted from map so event was already processed or should not be processed |
| 12 | if s.fileIndex.fileMap[relativePath] == nil { |
| 13 | return false |
| 14 | } |
| 15 | |
| 16 | // Exclude symbolic links |
| 17 | if s.fileIndex.fileMap[relativePath].IsSymbolicLink { |
| 18 | return false |
| 19 | } |
| 20 | |
| 21 | // Exclude changes on the exclude list |
| 22 | if s.ignoreMatcher != nil { |
| 23 | if s.ignoreMatcher.Matches(relativePath, s.fileIndex.fileMap[relativePath].IsDirectory) { |
| 24 | return false |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | // Exclude changes on the upload exclude list |
| 29 | if s.uploadIgnoreMatcher != nil { |
| 30 | if s.ignoreMatcher.Matches(relativePath, s.fileIndex.fileMap[relativePath].IsDirectory) { |
| 31 | return false |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | return true |
| 36 | } |
| 37 | |
| 38 | // s.fileIndex needs to be locked before this function is called |
| 39 | func shouldUpload(s *Sync, fileInformation *FileInformation, log log.Logger) bool { |