[tracker/tracker-0.6] Ensure a transaction is started right after getting metadata/text.



commit ad842250d8a01826f8afe746bc89b2bfd6c89c92
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue May 5 15:17:17 2009 +0200

    Ensure a transaction is started right after getting metadata/text.
---
 src/tracker-indexer/tracker-indexer.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/src/tracker-indexer/tracker-indexer.c b/src/tracker-indexer/tracker-indexer.c
index 422f7da..3a25cad 100644
--- a/src/tracker-indexer/tracker-indexer.c
+++ b/src/tracker-indexer/tracker-indexer.c
@@ -1643,6 +1643,10 @@ item_add_or_update (TrackerIndexer        *indexer,
 		return;
 	}
 
+	if (G_UNLIKELY (!indexer->private->in_transaction)) {
+		start_transaction (indexer);
+	}
+
 	exists = tracker_data_query_service_exists (service, dirname, basename, &id, NULL, &enabled);
 
 	if (exists && !enabled) {
@@ -2130,6 +2134,10 @@ item_mark_for_removal (TrackerIndexer *indexer,
 		 dirname, 
 		 basename);
 
+	if (G_UNLIKELY (!indexer->private->in_transaction)) {
+		start_transaction (indexer);
+	}
+
 	/* The file is not anymore in the filesystem. Obtain
 	 * the service type from the DB.
 	 */



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