[tracker] tracker-control: If using -r and -s together, wait 1s before -s



commit 523c7e54e6bc362240f8826b7d390be4825831b2
Author: Martyn Russell <martyn lanedo com>
Date:   Tue Feb 2 12:01:13 2010 +0000

    tracker-control: If using -r and -s together, wait 1s before -s
    
    Race conditions were observed without the wait and D-Bus errors about
    timeouts were being reported. This avoids that.

 src/tracker-control/tracker-control.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/tracker-control/tracker-control.c b/src/tracker-control/tracker-control.c
index fca74ea..7359c72 100644
--- a/src/tracker-control/tracker-control.c
+++ b/src/tracker-control/tracker-control.c
@@ -422,6 +422,13 @@ main (int argc, char **argv)
 		manager = tracker_miner_manager_new ();
 		miners = tracker_miner_manager_get_available (manager);
 
+		if (hard_reset || soft_reset) {
+			g_print ("%s\n", _("Waiting one second before starting minersâ?¦"));
+
+			/* Give a second's grace to avoid race conditions */
+			g_usleep (G_USEC_PER_SEC);
+		}
+
 		g_print ("%s\n", _("Starting minersâ?¦"));
 
 		/* Get the status of all miners, this will start all



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