[tracker/miner-web-review] libtracker-data: Attempt to fix journal replay
- From: Adrien Bustany <abustany src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/miner-web-review] libtracker-data: Attempt to fix journal replay
- Date: Thu, 18 Mar 2010 00:40:40 +0000 (UTC)
commit 4b28cef8675eb3a6f1db3fc46f9d13c1dbf7cb80
Author: Jürg Billeter <j bitron ch>
Date: Tue Mar 16 11:23:08 2010 +0100
libtracker-data: Attempt to fix journal replay
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 743dbef..3c99317 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -2477,16 +2477,20 @@ 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) {
if (tracker_property_get_data_type (property) != TRACKER_PROPERTY_TYPE_RESOURCE) {
g_warning ("Journal replay error: 'property with ID %d does not account URIs'", predicate_id);
} else {
resource_buffer_switch (NULL, graph_id, NULL, subject_id);
if (property == rdf_type) {
- cache_create_service_decomposed (class, NULL, graph_id);
+ class = g_hash_table_lookup (classes, GINT_TO_POINTER (object_id));
+ if (class) {
+ cache_create_service_decomposed (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;
@@ -2501,10 +2505,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);
}
} else if (type == TRACKER_DB_JOURNAL_DELETE_STATEMENT) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]