[tracker/journal: 16/22] libtracker-data: Attempt at fixing journal replay, delete



commit 8c164d1d437d3f925a77bed0ff6a4685ddd6a68a
Author: Philip Van Hoof <philip codeminded be>
Date:   Tue Mar 16 11:37:26 2010 +0100

    libtracker-data: Attempt at fixing journal replay, delete

 src/libtracker-data/tracker-data-update.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-update.c b/src/libtracker-data/tracker-data-update.c
index f9af928..3c448b2 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -2548,14 +2548,18 @@ tracker_data_replay_journal (GHashTable *classes,
 			tracker_db_journal_reader_get_statement_id (&graph_id, &subject_id, &predicate_id, &object_id);
 
 			property = g_hash_table_lookup (properties, GINT_TO_POINTER (predicate_id));
-			class = g_hash_table_lookup (classes, GINT_TO_POINTER (object_id));
 
-			if (property && class) {
+			if (property) {
 
 				resource_buffer_switch (NULL, graph_id, NULL, subject_id);
 
 				if (property == rdf_type) {
-					cache_delete_resource_type (class, NULL, graph_id);
+					class = g_hash_table_lookup (classes, GINT_TO_POINTER (object_id));
+					if (class) {
+						cache_delete_resource_type (class, NULL, graph_id);
+					} else {
+						g_warning ("Journal replay error: 'class with ID %d not found in the ontology'", object_id);
+					}
 				} else {
 					GError *new_error = NULL;
 
@@ -2567,10 +2571,7 @@ tracker_data_replay_journal (GHashTable *classes,
 					}
 				}
 			} else {
-				if (!class)
-					g_warning ("Journal replay error: 'class with ID %d not found in the ontology'", object_id);
-				if (!property)
-					g_warning ("Journal replay error: 'property with ID %d doesn't exist'", predicate_id);
+				g_warning ("Journal replay error: 'property with ID %d doesn't exist'", predicate_id);
 			}
 		}
 	}



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