[gnome-software] Do not keep trying to refresh a broken flatpak remote
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] Do not keep trying to refresh a broken flatpak remote
- Date: Wed, 28 Sep 2016 10:21:27 +0000 (UTC)
commit d8f7c4d7dbb76cd5475b382ae97995b96db91d50
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.
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 17e0307..c355ebf 100644
--- a/src/plugins/gs-flatpak.c
+++ b/src/plugins/gs-flatpak.c
@@ -470,7 +470,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() */
@@ -480,8 +483,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]