[tracker/miner-priority-queues: 19/22] libtracker-miner: Avoid triggering too often the ensure_mtime_cache() hack
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/miner-priority-queues: 19/22] libtracker-miner: Avoid triggering too often the ensure_mtime_cache() hack
- Date: Tue, 19 Jul 2011 11:15:04 +0000 (UTC)
commit 88718b46603bcff92f461ee6e491138a8a75336a
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 2fca0e5..efbe8e7 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -3110,7 +3110,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]