[tracker/tracker-store] tracker-indexer: Do not shut down automatically



commit 718686de32753ad87c405a6cbea97d9a285d6845
Author: Philip Van Hoof <philip codeminded be>
Date:   Wed Apr 22 17:54:20 2009 +0200

    tracker-indexer: Do not shut down automatically

 src/tracker-indexer/tracker-main.c |   52 +-----------------------------------
 1 files changed, 1 insertions(+), 51 deletions(-)
---
diff --git a/src/tracker-indexer/tracker-main.c b/src/tracker-indexer/tracker-main.c
index 398610b..b1c62e0 100644
--- a/src/tracker-indexer/tracker-main.c
+++ b/src/tracker-indexer/tracker-main.c
@@ -65,15 +65,11 @@
 	"\n"								  \
 	"  http://www.gnu.org/licenses/gpl.txt\n";
 
-#define QUIT_TIMEOUT 300 /* 5 minutes worth of seconds */
-
 static GMainLoop    *main_loop;
-static guint	     quit_timeout_id;
 
 static gboolean      version;
 static gint	     verbosity = -1;
 static gboolean      process_all;
-static gboolean      run_forever;
 static gchar       **modules;
 
 static GOptionEntry  entries[] = {
@@ -90,14 +86,6 @@ static GOptionEntry  entries[] = {
 	  G_OPTION_ARG_NONE, &process_all,
 	  N_("Index data from all enabled modules"),
 	  NULL },
-	{ "run-forever", 'f', 0,
-	  G_OPTION_ARG_NONE, &run_forever,
-	  N_("Run forever, only interesting for debugging purposes"),
-	  NULL },
-        { "modules", 'm', 0,
-          G_OPTION_ARG_STRING_ARRAY, &modules,
-          N_("Modules to be used when processing data"),
-          NULL },
 
 	{ NULL }
 };
@@ -217,25 +205,6 @@ initialize_priority (void)
 	}
 }
 
-static gboolean
-quit_timeout_cb (gpointer user_data)
-{
-	TrackerIndexer *indexer;
-
-	indexer = TRACKER_INDEXER (user_data);
-
-	if (tracker_indexer_get_stoppable (indexer)) {
-		g_message ("Indexer is still not running after %d seconds, quitting...",
-			   QUIT_TIMEOUT);
-		g_main_loop_quit (main_loop);
-		quit_timeout_id = 0;
-	} else {
-		g_message ("Indexer is now running, staying alive until finished...");
-	}
-
-	return FALSE;
-}
-
 static void
 indexer_finished_cb (TrackerIndexer *indexer,
 		     gdouble	     seconds_elapsed,
@@ -246,27 +215,12 @@ indexer_finished_cb (TrackerIndexer *indexer,
 {
 	g_message ("Finished indexing sent items");
 
-	if (interrupted && !run_forever) {
+	if (interrupted) {
 		g_message ("Indexer was told to shutdown");
 		g_main_loop_quit (main_loop);
 		return;
 	}
 
-	if (quit_timeout_id) {
-		g_message ("Cancelling previous quit timeout");
-		g_source_remove (quit_timeout_id);
-	}
-
-	if (!run_forever) {
-		g_message ("Waiting another %d seconds for more items before quitting...",
-			   QUIT_TIMEOUT);
-
-		quit_timeout_id = g_timeout_add_seconds_full (G_PRIORITY_DEFAULT,
-							      QUIT_TIMEOUT,
-							      quit_timeout_cb,
-							      g_object_ref (indexer),
-							      (GDestroyNotify) g_object_unref);
-	}
 }
 
 static void
@@ -427,10 +381,6 @@ main (gint argc, gchar *argv[])
 
 	tracker_turtle_shutdown ();
 
-	if (quit_timeout_id) {
-		g_source_remove (quit_timeout_id);
-	}
-
 	g_main_loop_unref (main_loop);
 	g_object_unref (indexer);
 



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