diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2016-12-26 21:49:44 +0100 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2017-01-16 17:18:59 +0100 |
commit | 6dd93a7ea2d3936f018d4ab4f630f9310ff13ea3 (patch) | |
tree | d7ed7d18e296f12993773bceb06ce21fa658aba9 | |
parent | ae27aaedd289b41c6418506892d4d0f39c77eac9 (diff) | |
download | tracker-6dd93a7ea2d3936f018d4ab4f630f9310ff13ea3.tar.gz |
libtracker-miner: Fully stop TrackerFileNotifier operations on errors
It oddly tried to just keep going, which may result in spurious deletes
or partial inserts. Sounds better to just drop the ball on the directory
at hand, it should be correctly indexed eventually.
-rw-r--r-- | src/libtracker-miner/tracker-file-notifier.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/libtracker-miner/tracker-file-notifier.c b/src/libtracker-miner/tracker-file-notifier.c index 4d3ec2467..5b1abe095 100644 --- a/src/libtracker-miner/tracker-file-notifier.c +++ b/src/libtracker-miner/tracker-file-notifier.c @@ -779,9 +779,11 @@ sparql_contents_query_cb (GObject *object, cursor = tracker_sparql_connection_query_finish (TRACKER_SPARQL_CONNECTION (object), result, &error); if (error) { - if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) - goto out; - g_warning ("Could not query directory contents: %s\n", error->message); + if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { + g_warning ("Could not query directory contents: %s\n", error->message); + finish_current_directory (notifier, TRUE); + } + goto out; } notifier = user_data; @@ -865,17 +867,19 @@ sparql_files_query_cb (GObject *object, GFile *directory; guint flags; + notifier = data->notifier; + priv = notifier->priv; + cursor = tracker_sparql_connection_query_finish (TRACKER_SPARQL_CONNECTION (object), result, &error); if (error) { - if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) - goto out; - g_warning ("Could not query indexed files: %s\n", error->message); + if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { + g_warning ("Could not query indexed files: %s\n", error->message); + finish_current_directory (notifier, TRUE); + } + goto out; } - notifier = data->notifier; - priv = notifier->priv; - if (cursor) { sparql_files_query_populate (notifier, cursor, TRUE); g_object_unref (cursor); |