[tracker] libtracker-miner: Delete directory altogether on interrupted crawling



commit a50c8a5a223a331e792244cbe183e7cda912e2fc
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Feb 24 00:47:41 2016 +0100

    libtracker-miner: Delete directory altogether on interrupted crawling
    
    We can't tell the extracted data is complete or valid, so give up on
    that data entirely.

 src/libtracker-miner/tracker-file-notifier.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-file-notifier.c b/src/libtracker-miner/tracker-file-notifier.c
index 4c654dd..f6cbb48 100644
--- a/src/libtracker-miner/tracker-file-notifier.c
+++ b/src/libtracker-miner/tracker-file-notifier.c
@@ -653,11 +653,14 @@ finish_current_directory (TrackerFileNotifier *notifier,
        directory = priv->current_index_root->current_dir;
        priv->current_index_root->current_dir = NULL;
 
-       /* We dispose regular files here, only directories are cached once crawling
-        * has completed.
+       /* If crawling was interrupted, we take all collected info as invalid.
+        * Otherwise we dispose regular files here, only directories are
+        * cached once crawling has completed.
         */
        tracker_file_system_forget_files (priv->file_system,
                                          directory,
+                                         interrupted ?
+                                         G_FILE_TYPE_UNKNOWN :
                                          G_FILE_TYPE_REGULAR);
 
        if (interrupted || !crawl_directory_in_current_root (notifier)) {


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