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



commit de8691a77b62885ad4e3b354400eb93f14b225ec
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 |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index 93e46b2..606ac5d 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -2132,12 +2132,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);
 }
@@ -2255,7 +2254,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;
                }
@@ -2307,7 +2306,7 @@ file_notifier_file_created (TrackerFileNotifier  *notifier,
                return;
 
        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);
        }
 }
@@ -2330,7 +2329,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);
        }
 }
@@ -2354,7 +2353,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);
        }
 }
@@ -2606,7 +2605,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]