[gnome-software/wip/kalev/gnome-3-22-prep: 18/52] Do not keep trying to refresh a broken flatpak remote



commit ae3646cd85849329ddfb52a9b71a4208f51860ea
Author: Richard Hughes <richard hughsie com>
Date:   Wed Sep 28 09:43:28 2016 +0100

    Do not keep trying to refresh a broken flatpak remote
    
    libflatpak has started returning G_IO_ERROR_NOT_FOUND if the remote is not
    usable, so if it does this on non-interactive refresh then add the remote to
    the hash list of remotes to ignore until the next explitit refresh.
    
    This fixes the poor search performance when a broken remote is installed.
    
    (cherry picked from commit d8f7c4d7dbb76cd5475b382ae97995b96db91d50)

 src/plugins/gs-flatpak.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/plugins/gs-flatpak.c b/src/plugins/gs-flatpak.c
index ce7b665..a2b9713 100644
--- a/src/plugins/gs-flatpak.c
+++ b/src/plugins/gs-flatpak.c
@@ -366,7 +366,10 @@ gs_flatpak_refresh_appstream (GsFlatpak *self, guint cache_age,
                if (!ret) {
                        if (g_error_matches (error_local,
                                             G_IO_ERROR,
-                                            G_IO_ERROR_FAILED)) {
+                                            G_IO_ERROR_FAILED) ||
+                           g_error_matches (error_local,
+                                            G_IO_ERROR,
+                                            G_IO_ERROR_NOT_FOUND)) {
                                g_debug ("Failed to get AppStream metadata: %s",
                                         error_local->message);
                                /* don't try to fetch this again until refresh() */
@@ -376,8 +379,10 @@ gs_flatpak_refresh_appstream (GsFlatpak *self, guint cache_age,
                                continue;
                        }
                        if ((flags & GS_PLUGIN_REFRESH_FLAGS_INTERACTIVE) == 0) {
-                               g_warning ("Failed to get AppStream metadata: %s",
-                                          error_local->message);
+                               g_warning ("Failed to get AppStream metadata: %s [%s:%i]",
+                                          error_local->message,
+                                          g_quark_to_string (error_local->domain),
+                                          error_local->code);
                                continue;
                        }
                        g_set_error (error,


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