Commit 65249834 authored by Carlos Garnacho's avatar Carlos Garnacho

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.
parent bb5a538f
......@@ -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;
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 *
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment