[gnome-software/gnome-3-10] Do not fail to get the updates if getting the history fails
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/gnome-3-10] Do not fail to get the updates if getting the history fails
- Date: Wed, 23 Oct 2013 08:12:07 +0000 (UTC)
commit 88af556759bc563c95e27910e019807199bc3df9
Author: Richard Hughes <richard hughsie com>
Date: Wed Oct 23 09:10:41 2013 +0100
Do not fail to get the updates if getting the history fails
It takes 226ms to get the history of 849 packages, which is slightly above the
current timeout value. Increase this to something much larger, and additionally
do not fail the refine if the method takes longer than this. The history data is
supplemental afterall and not explicitly required.
src/plugins/gs-plugin-packagekit-history.c | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/src/plugins/gs-plugin-packagekit-history.c b/src/plugins/gs-plugin-packagekit-history.c
index c43c9db..5ec9618 100644
--- a/src/plugins/gs-plugin-packagekit-history.c
+++ b/src/plugins/gs-plugin-packagekit-history.c
@@ -26,6 +26,8 @@
#include <gs-plugin.h>
+#define GS_PLUGIN_PACKAGEKIT_HISTORY_TIMEOUT 5000 /* ms */
+
struct GsPluginPrivate {
GDBusProxy *proxy;
};
@@ -173,7 +175,7 @@ gs_plugin_packagekit_refine (GsPlugin *plugin,
"GetPackageHistory",
g_variant_new ("(^asu)", package_names, 0),
G_DBUS_CALL_FLAGS_NONE,
- 200, /* 200ms should be more than enough... */
+ GS_PLUGIN_PACKAGEKIT_HISTORY_TIMEOUT,
cancellable,
&error_local);
if (result == NULL) {
@@ -190,6 +192,16 @@ gs_plugin_packagekit_refine (GsPlugin *plugin,
app = GS_APP (l->data);
gs_app_set_install_date (app, GS_APP_INSTALL_DATE_UNKNOWN);
}
+ } else if (g_error_matches (error_local,
+ G_IO_ERROR,
+ G_IO_ERROR_TIMED_OUT)) {
+ g_debug ("No history as PackageKit took too long: %s",
+ error_local->message);
+ g_error_free (error_local);
+ for (l = list; l != NULL; l = l->next) {
+ app = GS_APP (l->data);
+ gs_app_set_install_date (app, GS_APP_INSTALL_DATE_UNKNOWN);
+ }
} else {
ret = FALSE;
g_propagate_error (error, error_local);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]