[tracker/direct-access: 8/18] tracker-store: Turtle import improvements
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/direct-access: 8/18] tracker-store: Turtle import improvements
- Date: Tue, 6 Jul 2010 08:17:44 +0000 (UTC)
commit 19f3f59c8af67a92ef2f3811a464e39fc9f47fb8
Author: Jürg Billeter <j bitron ch>
Date: Thu Jul 1 16:30:37 2010 +0200
tracker-store: Turtle import improvements
src/tracker-store/tracker-events.c | 8 ++++++++
src/tracker-store/tracker-events.h | 1 +
src/tracker-store/tracker-store.c | 11 +++++++++++
3 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/src/tracker-store/tracker-events.c b/src/tracker-store/tracker-events.c
index ae3064d..583e2bf 100644
--- a/src/tracker-store/tracker-events.c
+++ b/src/tracker-store/tracker-events.c
@@ -144,6 +144,14 @@ tracker_events_reset (void)
private->frozen = FALSE;
}
+void
+tracker_events_freeze (void)
+{
+ g_return_if_fail (private != NULL);
+
+ private->frozen = TRUE;
+}
+
GArray *
tracker_events_get_pending (void)
{
diff --git a/src/tracker-store/tracker-events.h b/src/tracker-store/tracker-events.h
index 01629a4..981233c 100644
--- a/src/tracker-store/tracker-events.h
+++ b/src/tracker-store/tracker-events.h
@@ -48,6 +48,7 @@ void tracker_events_insert (const gchar *uri,
TrackerDBusEventsType type);
GArray *tracker_events_get_pending (void);
void tracker_events_reset (void);
+void tracker_events_freeze (void);
G_END_DECLS
diff --git a/src/tracker-store/tracker-store.c b/src/tracker-store/tracker-store.c
index 903fbfa..d203038 100644
--- a/src/tracker-store/tracker-store.c
+++ b/src/tracker-store/tracker-store.c
@@ -38,6 +38,7 @@
#include <libtracker-data/tracker-sparql-query.h>
#include "tracker-store.h"
+#include "tracker-events.h"
#define TRACKER_STORE_MAX_CONCURRENT_QUERIES 2
@@ -139,9 +140,12 @@ process_turtle_file (TrackerTurtleReader *reader, GError **error)
{
GError *new_error = NULL;
+ tracker_events_freeze ();
+
tracker_data_begin_transaction (&new_error);
if (new_error) {
g_propagate_error (error, new_error);
+ tracker_events_reset ();
return;
}
@@ -162,11 +166,15 @@ process_turtle_file (TrackerTurtleReader *reader, GError **error)
tracker_turtle_reader_get_object (reader),
&new_error);
}
+ if (!new_error) {
+ tracker_data_update_buffer_might_flush (&new_error);
+ }
}
if (new_error) {
tracker_data_rollback_transaction ();
g_propagate_error (error, new_error);
+ tracker_events_reset ();
return;
}
@@ -174,8 +182,11 @@ process_turtle_file (TrackerTurtleReader *reader, GError **error)
if (new_error) {
tracker_data_rollback_transaction ();
g_propagate_error (error, new_error);
+ tracker_events_reset ();
return;
}
+
+ tracker_events_reset ();
}
static gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]