[tracker/tracker-0.10] tracker-miner-fs: Don't do initial sleep if no mtime check is going to happen



commit 489bfeb775cf4dc1ae38bd11639fae45413a7411
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue May 24 12:22:55 2011 +0200

    tracker-miner-fs: Don't do initial sleep if no mtime check is going to happen
    
    Crawling will be fairly fast if no mtime checks are to be done (which is the
    most usual case), so avoid initial sleep so we get the monitors in place ASAP.
    Fixes NB#252898.

 src/miners/fs/tracker-main.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/miners/fs/tracker-main.c b/src/miners/fs/tracker-main.c
index fb224b3..dc2eb44 100644
--- a/src/miners/fs/tracker-main.c
+++ b/src/miners/fs/tracker-main.c
@@ -279,10 +279,17 @@ miner_handle_first_cb (gpointer data)
 }
 
 static void
-miner_handle_first (TrackerConfig *config)
+miner_handle_first (TrackerConfig *config,
+		    gboolean       do_mtime_checking)
 {
 	gint initial_sleep;
 
+	if (!do_mtime_checking) {
+		g_debug ("Avoiding initial sleep, no mtime check needed");
+		miner_handle_next ();
+		return;
+	}
+
 	/* If requesting to run as no-daemon, start right away */
 	if (no_daemon) {
 		miner_handle_next ();
@@ -291,6 +298,7 @@ miner_handle_first (TrackerConfig *config)
 
 	/* If no need to initially sleep, start right away */
 	initial_sleep = tracker_config_get_initial_sleep (config);
+
 	if (initial_sleep <= 0) {
 		miner_handle_next ();
 		return;
@@ -822,7 +830,7 @@ main (gint argc, gchar *argv[])
 
 	tracker_thumbnailer_init ();
 
-	miner_handle_first (config);
+	miner_handle_first (config, do_mtime_checking);
 
 	/* Go, go, go! */
 	g_main_loop_run (main_loop);



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