[tracker/tracker-0.6] Fixes NB#140077, Send statistics signal only at the end of the indexing



commit bdb33452e3671e0783571cea975420f0ec938363
Author: Martyn Russell <martyn lanedo com>
Date:   Wed Sep 23 10:49:58 2009 +0100

    Fixes NB#140077, Send statistics signal only at the end of the indexing

 src/trackerd/tracker-daemon.c |   26 +++++++++++++++-----------
 1 files changed, 15 insertions(+), 11 deletions(-)
---
diff --git a/src/trackerd/tracker-daemon.c b/src/trackerd/tracker-daemon.c
index 58ea155..519253b 100644
--- a/src/trackerd/tracker-daemon.c
+++ b/src/trackerd/tracker-daemon.c
@@ -45,8 +45,8 @@
 
 #define TRACKER_TYPE_G_STRV_ARRAY  (dbus_g_type_get_collection ("GPtrArray", G_TYPE_STRV))
 
-/* In seconds (2 minutes for now) */
-#define STATS_CACHE_LIFETIME 120
+/* In seconds, if this is < 1, it is disabled */
+#define STATS_CACHE_LIFETIME 0
 
 typedef struct {
 	TrackerConfig	 *config;
@@ -159,11 +159,13 @@ indexer_started_cb (DBusGProxy *proxy,
 		return;
 	}
 
-	g_debug ("Starting statistics cache timeout");
-	priv->stats_cache_timeout_id = 
-		g_timeout_add_seconds (STATS_CACHE_LIFETIME,
-				       stats_cache_timeout,
-				       user_data);
+	if (STATS_CACHE_LIFETIME > 0) {
+		g_debug ("Starting statistics cache timeout");
+		priv->stats_cache_timeout_id = 
+			g_timeout_add_seconds (STATS_CACHE_LIFETIME,
+					       stats_cache_timeout,
+					       user_data);
+	}
 }
 
 static void
@@ -228,10 +230,12 @@ tracker_daemon_init (TrackerDaemon *object)
 						   g_free,
 						   NULL);
 
-	priv->stats_cache_timeout_id = 
-		g_timeout_add_seconds (STATS_CACHE_LIFETIME,
-				       stats_cache_timeout,
-				       object);
+	if (STATS_CACHE_LIFETIME > 0) {
+		priv->stats_cache_timeout_id = 
+			g_timeout_add_seconds (STATS_CACHE_LIFETIME,
+					       stats_cache_timeout,
+					       object);
+	}
 }
 
 static void



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