[tracker] libtracker-miner: Cancel ops in current buffers if a delete affects the file
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] libtracker-miner: Cancel ops in current buffers if a delete affects the file
- Date: Wed, 24 Feb 2016 13:25:50 +0000 (UTC)
commit 0eb420842df0ba04c64026c0c396f93bd0c235e9
Author: Carlos Garnacho <carlosg gnome org>
Date: Wed Feb 24 12:58:43 2016 +0100
libtracker-miner: Cancel ops in current buffers if a delete affects the file
If a folder being deleted affects operations currently in the currently
issued tasks (eg. those we emitted ::process-file on) and writeback buffers,
those operations would still attempt to proceed, with different degrees
of success.
src/libtracker-miner/tracker-miner-fs.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index 4c1239d..3022bd9 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -350,6 +350,8 @@ static void task_pool_cancel_foreach (gpointer d
static void task_pool_limit_reached_notify_cb (GObject *object,
GParamSpec *pspec,
gpointer user_data);
+static void writeback_pool_cancel_foreach (gpointer data,
+ gpointer user_data);
static GQuark quark_file_iri = 0;
static GInitableIface* miner_fs_initable_parent_iface;
@@ -3029,6 +3031,16 @@ file_notifier_file_deleted (TrackerFileNotifier *notifier,
{
TrackerMinerFS *fs = user_data;
+ if (tracker_file_notifier_get_file_type (notifier, file) == G_FILE_TYPE_DIRECTORY) {
+ /* Cancel all pending tasks on files inside the path given by file */
+ tracker_task_pool_foreach (fs->priv->task_pool,
+ task_pool_cancel_foreach,
+ file);
+ tracker_task_pool_foreach (fs->priv->writeback_pool,
+ writeback_pool_cancel_foreach,
+ file);
+ }
+
if (check_item_queues (fs, QUEUE_DELETED, file, NULL)) {
miner_fs_queue_file (fs, fs->priv->items_deleted, file, FALSE);
item_queue_handlers_set_up (fs);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]