[tracker/tracker-1.4] tracker-miner-fs: Reset retry counter when we need to prepend parents



commit 43663b937f9f29ca444733e933b31386deb1be6e
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Jul 5 21:54:29 2015 +0200

    tracker-miner-fs: Reset retry counter when we need to prepend parents
    
    The situation where a parent directory has to be prepended in order to
    process the current file is rare, mainly reserved to IndexFile calls
    on files out of watched dirs.
    
    This is a corner situation, but it is a legit place where we have to
    put the file back again in the queue, and thus we shouldn't increase
    the retry counter.
    
    This nominally fixes the indexing of gnome-documents-getting-started.pdf
    on a fresh-out tracker DB, as requested by gnome-shell.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=751992

 src/libtracker-miner/tracker-miner-fs.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index 435c0b6..8ea345e 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -2061,6 +2061,14 @@ should_wait (TrackerMinerFS *fs,
        return FALSE;
 }
 
+static void
+item_reset_reentry_counter (TrackerMinerFS *fs,
+                            GFile          *file)
+{
+       g_object_set_qdata (G_OBJECT (file),
+                           fs->priv->quark_reentry_counter, NULL);
+}
+
 static gboolean
 item_reenqueue_full (TrackerMinerFS       *fs,
                      TrackerPriorityQueue *item_queue,
@@ -2568,6 +2576,8 @@ item_queue_handlers_cb (gpointer user_data)
                                item_queue = fs->priv->items_updated;
                        }
 
+                       item_reset_reentry_counter (fs, file);
+
                        /* Parent isn't indexed yet, reinsert the task into the queue,
                         * but forcily prepended by its parent so its indexing is
                         * ensured, tasks are inserted at a higher priority so they


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