[tracker-miners/wip/carlosg/shuffle-libtracker-miner: 51/116] libtracker-miner: Emit monitor ::file-created for directories immediately



commit 09b9d35bc029e2d509041fedd86ea6a1b44f29d5
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Feb 12 01:23:06 2018 +0100

    libtracker-miner: Emit monitor ::file-created for directories immediately
    
    On monitor events on directories we used to trigger a full crawling, and
    only notified the directory during recursive handling. However other monitor
    events may happen immediately on the child, which would get queued
    immediately before the parent folder (which is being idly crawled).
    
    Emit ::file-created immediately here in order to ensure correct ordering
    in the TrackerMinerFS queue. If notifier_queue_root() ends up notifying
    about the file again, the event would get eventually discarded or simply
    handled as an update.

 src/libtracker-miner/tracker-file-notifier.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/src/libtracker-miner/tracker-file-notifier.c b/src/libtracker-miner/tracker-file-notifier.c
index 4c321d5e5..f4a0e30d0 100644
--- a/src/libtracker-miner/tracker-file-notifier.c
+++ b/src/libtracker-miner/tracker-file-notifier.c
@@ -1152,7 +1152,13 @@ monitor_item_created_cb (TrackerMonitor *monitor,
                                                                  file_type,
                                                                  NULL);
                        notifier_queue_root (notifier, canonical, flags);
-                       return;
+
+                       /* Fall though, even though the folder can be notified
+                        * indirectly through notifier_queue_root(), we want
+                        * ::file-created to be emitted ASAP so it is ensured
+                        * to be processed before any possible monitor events
+                        * we might get afterwards.
+                        */
                }
        }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]