[tracker-miners/wip/carlosg/speed-track: 33/40] libtracker-miner: Avoid doubly processing directories




commit fc5a8f9b0033e4848003a91500af164c4c501e9b
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sat Oct 17 15:55:24 2020 +0200

    libtracker-miner: Avoid doubly processing directories
    
    Directories in recursively indexed roots are doubly checked here,
    once when processing the parent directory children, and another
    when processing the directory and its children.
    
    Avoid the latter, so we only go through these bits once.

 src/libtracker-miner/tracker-file-notifier.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/src/libtracker-miner/tracker-file-notifier.c b/src/libtracker-miner/tracker-file-notifier.c
index 8328ca3d8..dc1a00c1d 100644
--- a/src/libtracker-miner/tracker-file-notifier.c
+++ b/src/libtracker-miner/tracker-file-notifier.c
@@ -420,6 +420,10 @@ file_notifier_add_node_foreach (GNode    *node,
        file = node->data;
        file_info = tracker_crawler_get_file_info (priv->crawler, file);
 
+       if (G_NODE_IS_ROOT (node) &&
+           !tracker_indexing_tree_file_is_root (priv->indexing_tree, file))
+               return FALSE;
+
        if (file_info) {
                GFileType file_type;
                guint64 _time;


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