Commit 58da1a0a authored by Carlos Garnacho's avatar Carlos Garnacho

libtracker-miner: Remove operations on children on deleted folders

This is an optimization to reduce the number of queries that we
perform across the deletion of large directory trees.
parent 3e1d3d18
......@@ -2884,6 +2884,30 @@ check_item_queues (TrackerMinerFS *fs,
cancel_writeback_task (fs, file);
}
if (tracker_file_notifier_get_file_type (fs->priv->file_notifier,
file) == G_FILE_TYPE_DIRECTORY) {
if (tracker_priority_queue_foreach_remove (fs->priv->items_updated,
(GEqualFunc) g_file_has_parent,
file,
(GDestroyNotify) g_object_unref)) {
g_debug (" Deleting previous unhandled UPDATED events on children");
}
if (tracker_priority_queue_foreach_remove (fs->priv->items_created,
(GEqualFunc) g_file_has_parent,
file,
(GDestroyNotify) g_object_unref)) {
g_debug (" Deleting previous unhandled CREATED events on children");
}
if (tracker_priority_queue_foreach_remove (fs->priv->items_deleted,
(GEqualFunc) g_file_has_parent,
file,
(GDestroyNotify) g_object_unref)) {
g_debug (" Deleting previous unhandled DELETED events on children");
}
}
/* Remove all previous updates */
if (tracker_priority_queue_foreach_remove (fs->priv->items_updated,
(GEqualFunc) g_file_equal,
......
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