[tracker/architecture-indexer-noshutdown] Removed the functionality that makes the indexer shutdown



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

    Removed the functionality that makes the indexer shutdown
---
 src/tracker-indexer/tracker-main.c |   52 +----------------------------------
 1 files changed, 2 insertions(+), 50 deletions(-)

diff --git a/src/tracker-indexer/tracker-main.c b/src/tracker-indexer/tracker-main.c
index 8293e98..0456578 100644
--- a/src/tracker-indexer/tracker-main.c
+++ b/src/tracker-indexer/tracker-main.c
@@ -70,12 +70,10 @@
 #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[] = {
@@ -92,15 +90,7 @@ 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 }
 };
 
@@ -219,25 +209,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,
@@ -248,27 +219,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
@@ -429,10 +385,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]