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



commit 713018bfc7e0518032f32ac5fe94432d2082ec2f
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 83860f8..e3bf876 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]