[tracker/wip/miner-priority-queues: 19/19] libtracker-miner: Avoid triggering too often the ensure_mtime_cache() hack



commit 6b8403af78b935161173faf634cf7093e184dbf2
Author: Carlos Garnacho <carlos lanedo com>
Date:   Wed Jul 6 18:06:48 2011 +0200

    libtracker-miner: Avoid triggering too often the ensure_mtime_cache() hack
    
    The hack introduced in commit 22087297 is meant to cope with the "delete
    folder and move another on top" situation, forcing reindex if the operation
    was in the middle of being processed. This situation is most relevant for
    monitor events, as deletes can take quite some time to happen recursively.
    
    However, on unclean shutdowns, this condition also happens often. Even if
    the directory is already indexed in the store, it is pushed for mtime
    check into the queues, which looks exactly the same to ensure_mtime_check().
    The final effect was that plenty of files were being reindexed for the sake
    of it.

 src/libtracker-miner/tracker-miner-fs.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index 9411d71..223436a 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -3165,7 +3165,8 @@ ensure_mtime_cache (TrackerMinerFS *fs,
 	 * Before querying the store, check if the parent directory is scheduled to
 	 * be added, and if so, leave the mtime cache empty.
 	 */
-	if (tracker_priority_queue_find (fs->priv->items_created, NULL,
+	if (fs->priv->been_crawled &&
+	    tracker_priority_queue_find (fs->priv->items_created, NULL,
 	                                 (GEqualFunc) g_file_equal,
 	                                 parent) != NULL) {
 		uri = g_file_get_uri (file);



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