| 1323 | } |
| 1324 | |
| 1325 | func (f *folder) emitDiskChangeEvents(fs []protocol.FileInfo, typeOfEvent events.EventType) { |
| 1326 | for _, file := range fs { |
| 1327 | if file.IsInvalid() { |
| 1328 | continue |
| 1329 | } |
| 1330 | |
| 1331 | objType := "file" |
| 1332 | action := "modified" |
| 1333 | |
| 1334 | if file.IsDeleted() { |
| 1335 | action = "deleted" |
| 1336 | } |
| 1337 | |
| 1338 | if file.IsSymlink() { |
| 1339 | objType = "symlink" |
| 1340 | } else if file.IsDirectory() { |
| 1341 | objType = "dir" |
| 1342 | } |
| 1343 | |
| 1344 | // Two different events can be fired here based on what EventType is passed into function |
| 1345 | f.evLogger.Log(typeOfEvent, map[string]string{ |
| 1346 | "folder": f.ID, |
| 1347 | "folderID": f.ID, // incorrect, deprecated, kept for historical compliance |
| 1348 | "label": f.Label, |
| 1349 | "action": action, |
| 1350 | "type": objType, |
| 1351 | "path": filepath.FromSlash(file.Name), |
| 1352 | "modifiedBy": file.ModifiedBy.String(), |
| 1353 | }) |
| 1354 | } |
| 1355 | } |
| 1356 | |
| 1357 | func (f *folder) handleForcedRescans(ctx context.Context) error { |
| 1358 | f.forcedRescanPathsMut.Lock() |