[gnome-software/gnome-3-22] Do not keep trying to refresh a broken flatpak remote
- From: Kalev Lember <klember src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/gnome-3-22] Do not keep trying to refresh a broken flatpak remote
- Date: Mon, 7 Nov 2016 13:38:27 +0000 (UTC)
commit 392f6261f7fdca6e1a798c25fc3deac4f9cdb81a
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 f112abd..28daa96 100644
--- a/src/plugins/gs-flatpak.c
+++ b/src/plugins/gs-flatpak.c
@@ -410,7 +410,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() */
@@ -420,8 +423,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]