[tracker-miners/wip/carlosg/tracker-3.0-api-breaks: 47/57] libtracker-miner: Adapt to update_array behavior change



commit f6393bba67c2c217add3dd7a48a7604bb2d8918b
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Dec 31 12:37:36 2019 +0100

    libtracker-miner: Adapt to update_array behavior change
    
    The TrackerDecorator object used to selectively blacklist failed
    items in a failed transaction. Do it wholesome ATM, we don't really
    expect items to fail here, besides faulty modules pushing SPARQL
    updates that don't conform to Nepomuk.

 src/libtracker-miner/tracker-decorator.c | 18 +++---------------
 1 file changed, 3 insertions(+), 15 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-decorator.c b/src/libtracker-miner/tracker-decorator.c
index 7bcf11242..eecfd2a17 100644
--- a/src/libtracker-miner/tracker-decorator.c
+++ b/src/libtracker-miner/tracker-decorator.c
@@ -341,34 +341,22 @@ decorator_commit_cb (GObject      *object,
        TrackerDecoratorPrivate *priv;
        TrackerDecorator *decorator;
        GError *error = NULL;
-       GPtrArray *errors;
        guint i;
 
        decorator = user_data;
        priv = decorator->priv;
        conn = TRACKER_SPARQL_CONNECTION (object);
-       errors = tracker_sparql_connection_update_array_finish (conn, result, &error);
 
-       if (error) {
+       if (!tracker_sparql_connection_update_array_finish (conn, result, &error)) {
                g_warning ("There was an error pushing metadata: %s\n", error->message);
-       }
 
-       if (errors) {
-               for (i = 0; i < errors->len; i++) {
+               for (i = 0; i < priv->commit_buffer->len; i++) {
                        SparqlUpdate *update;
-                       GError *child_error;
 
-                       child_error = g_ptr_array_index (errors, i);
                        update = &g_array_index (priv->commit_buffer, SparqlUpdate, i);
-
-                       if (!child_error)
-                               continue;
-
                        decorator_blacklist_add (decorator, update->id);
-                       item_warn (conn, update->id, update->sparql, child_error);
+                       item_warn (conn, update->id, update->sparql, error);
                }
-
-               g_ptr_array_unref (errors);
        }
 
        g_clear_pointer (&priv->commit_buffer, g_array_unref);


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