[tracker-miners/wip/carlosg/delay-monitors: 10/19] libtracker-miner: Proceed as expected on TrackerCrawler returning FALSE




commit 7e7dd068354e6a0acd1d6e7d8d67e18416c1b21d
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Nov 8 18:00:38 2020 +0100

    libtracker-miner: Proceed as expected on TrackerCrawler returning FALSE
    
    Not all error conditions mean that crawling was interrupted, check explicitly
    that the operation was cancelled, And proceed regularly with the others.

 src/libtracker-miner/tracker-file-notifier.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-file-notifier.c b/src/libtracker-miner/tracker-file-notifier.c
index 6092ab087..408e049f3 100644
--- a/src/libtracker-miner/tracker-file-notifier.c
+++ b/src/libtracker-miner/tracker-file-notifier.c
@@ -482,8 +482,11 @@ crawler_get_cb (TrackerCrawler *crawler,
                                         &files_found,
                                         &files_ignored,
                                         &error)) {
+               gboolean interrupted;
+
                if (error &&
-                   !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
+                   !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED) &&
+                   !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND)) {
                        gchar *uri;
 
                        uri = g_file_get_uri (directory);
@@ -491,8 +494,12 @@ crawler_get_cb (TrackerCrawler *crawler,
                                   uri, error->message);
                        g_free (uri);
                }
+
+               interrupted = error &&
+                       g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED);
+
                tracker_monitor_remove (priv->monitor, directory);
-               finish_current_directory (notifier, TRUE);
+               finish_current_directory (notifier, interrupted);
                g_clear_error (&error);
                return;
        }


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