summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2023-04-09 21:29:44 +0200
committerCarlos Garnacho <carlosg@gnome.org>2023-04-09 23:53:06 +0200
commitd33618404721418d19da6694a2eefd81f64dccdb (patch)
tree0dcce8db2bd4a9d56ea9e4e41e6f2faaff874635
parent32b7f318453ac777340b3879271da92e6f2e91fb (diff)
downloadtracker-d33618404721418d19da6694a2eefd81f64dccdb.tar.gz
direct: Prune only content of correctly finished batches
Commit 944988326 attempted made finished batches cheap to keep in memory, for languages where we don't have full control of object lifetime (e.g. GJS). This however broke tracker-miner-fs-3 handling of failures, since that tries to peek at TrackerResources that were already disposed by the TrackerBatch being cleared of content, in order to retry, or report for `tracker3 status`. In order to fix that and keep the improvement for the common case (i.e. success), only clear the TrackerBatch contents if the operation finished successfully. Fixes: 944988326 ("libtracker-sparql/direct: Prune content of already executed batches")
-rw-r--r--src/libtracker-sparql/direct/tracker-direct-batch.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/libtracker-sparql/direct/tracker-direct-batch.c b/src/libtracker-sparql/direct/tracker-direct-batch.c
index 663d23dce..3f21eed11 100644
--- a/src/libtracker-sparql/direct/tracker-direct-batch.c
+++ b/src/libtracker-sparql/direct/tracker-direct-batch.c
@@ -310,8 +310,6 @@ tracker_direct_batch_update (TrackerDirectBatch *batch,
break;
}
- g_array_set_size (priv->array, 0);
-
if (!inner_error)
tracker_data_update_buffer_flush (data, &inner_error);
@@ -324,6 +322,7 @@ tracker_direct_batch_update (TrackerDirectBatch *batch,
if (inner_error)
goto error;
+ g_array_set_size (priv->array, 0);
g_hash_table_unref (bnodes);
g_hash_table_unref (visited);