[tracker/tracker-1.10] libtracker-miner: Always fallback to URN query when queueing file



commit a37012e37da2945fd214aca629bedba7a3b70d84
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Sep 25 12:12:47 2017 +0200

    libtracker-miner: Always fallback to URN query when queueing file
    
    Tracker may end up with nfo:FileDataObject prior to handling monitor
    events. Be it leftover data from previous bugs, explicit "tracker index"
    calls, or data from some other application.
    
    As we can't be really sure of the data consistence, always fallback to
    a URN query so we don't break nie:url UNIQUE constraint (inverse functional
    property in SPARQL parlance).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=786132

 src/libtracker-miner/tracker-miner-fs.c |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index e3b7c12..de8f356 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -2821,12 +2821,11 @@ miner_fs_cache_file_urn (TrackerMinerFS *fs,
 static void
 miner_fs_queue_file (TrackerMinerFS       *fs,
                      TrackerPriorityQueue *item_queue,
-                     GFile                *file,
-                     gboolean              query_urn)
+                     GFile                *file)
 {
        gint priority;
 
-       miner_fs_cache_file_urn (fs, file, query_urn);
+       miner_fs_cache_file_urn (fs, file, TRUE);
        priority = miner_fs_get_queue_priority (fs, file);
        tracker_priority_queue_add (item_queue, g_object_ref (file), priority);
 }
@@ -2982,7 +2981,7 @@ check_item_queues (TrackerMinerFS *fs,
                         */
                        g_debug ("  Found matching unhandled CREATED event "
                                 "for source file, merging both events together");
-                       miner_fs_queue_file (fs, fs->priv->items_created, other_file, FALSE);
+                       miner_fs_queue_file (fs, fs->priv->items_created, other_file);
 
                        return FALSE;
                }
@@ -3017,7 +3016,7 @@ file_notifier_file_created (TrackerFileNotifier  *notifier,
        TrackerMinerFS *fs = user_data;
 
        if (check_item_queues (fs, QUEUE_CREATED, file, NULL)) {
-               miner_fs_queue_file (fs, fs->priv->items_created, file, FALSE);
+               miner_fs_queue_file (fs, fs->priv->items_created, file);
                item_queue_handlers_set_up (fs);
        }
 }
@@ -3040,7 +3039,7 @@ file_notifier_file_deleted (TrackerFileNotifier  *notifier,
        }
 
        if (check_item_queues (fs, QUEUE_DELETED, file, NULL)) {
-               miner_fs_queue_file (fs, fs->priv->items_deleted, file, FALSE);
+               miner_fs_queue_file (fs, fs->priv->items_deleted, file);
                item_queue_handlers_set_up (fs);
        }
 }
@@ -3071,7 +3070,7 @@ file_notifier_file_updated (TrackerFileNotifier  *notifier,
                                            GINT_TO_POINTER (TRUE));
                }
 
-               miner_fs_queue_file (fs, fs->priv->items_updated, file, TRUE);
+               miner_fs_queue_file (fs, fs->priv->items_updated, file);
                item_queue_handlers_set_up (fs);
        }
 }
@@ -3417,7 +3416,7 @@ tracker_miner_fs_directory_remove_full (TrackerMinerFS *fs,
                         * to preserve remove_full() semantics.
                         */
                        trace_eq_push_tail ("DELETED", file, "on remove full");
-                       miner_fs_queue_file (fs, fs->priv->items_deleted, file, FALSE);
+                       miner_fs_queue_file (fs, fs->priv->items_deleted, file);
                        item_queue_handlers_set_up (fs);
                }
 
@@ -3461,7 +3460,7 @@ check_file_parents (TrackerMinerFS *fs,
 
        for (p = parents; p; p = p->next) {
                trace_eq_push_tail ("UPDATED", p->data, "checking file parents");
-               miner_fs_queue_file (fs, fs->priv->items_updated, p->data, TRUE);
+               miner_fs_queue_file (fs, fs->priv->items_updated, p->data);
                g_object_unref (p->data);
        }
 


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