[tracker] libtracker-miner: Ensure sparql buffer keeps flushing
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] libtracker-miner: Ensure sparql buffer keeps flushing
- Date: Sun, 9 Jul 2017 22:13:08 +0000 (UTC)
commit 49847c92db72bdb3f99ad33ff695c106d61c55f1
Author: Carlos Garnacho <carlosg gnome org>
Date: Sun Jul 9 19:08:54 2017 +0200
libtracker-miner: Ensure sparql buffer keeps flushing
The sparql buffer might get full again with new tasks before the
update_array operation for the current batch returned. In this case
nothing will kick the TrackerMinerFS again, nor the SPARQL buffer
from flushing again. Fix this by just flushing again, the miner
will follow as soon as the SPARQL buffer is below limits.
src/libtracker-miner/tracker-sparql-buffer.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-sparql-buffer.c b/src/libtracker-miner/tracker-sparql-buffer.c
index 5d0be93..95f9c8e 100644
--- a/src/libtracker-miner/tracker-sparql-buffer.c
+++ b/src/libtracker-miner/tracker-sparql-buffer.c
@@ -246,6 +246,7 @@ tracker_sparql_buffer_update_array_cb (GObject *object,
gpointer user_data)
{
TrackerSparqlBufferPrivate *priv;
+ TrackerSparqlBuffer *buffer;
GError *global_error = NULL;
GPtrArray *sparql_array_errors;
UpdateArrayData *update_data;
@@ -253,7 +254,8 @@ tracker_sparql_buffer_update_array_cb (GObject *object,
/* Get arrays of errors and queries */
update_data = user_data;
- priv = TRACKER_SPARQL_BUFFER (update_data->buffer)->priv;
+ buffer = TRACKER_SPARQL_BUFFER (update_data->buffer);
+ priv = buffer->priv;
priv->n_updates--;
g_debug ("(Sparql buffer) Finished array-update with %u tasks",
@@ -338,6 +340,10 @@ tracker_sparql_buffer_update_array_cb (GObject *object,
if (global_error) {
g_error_free (global_error);
}
+
+ if (tracker_task_pool_limit_reached (TRACKER_TASK_POOL (buffer))) {
+ tracker_sparql_buffer_flush (buffer, "SPARQL buffer limit reached (after flush)");
+ }
}
static gchar *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]