[gnome-software/gnome-3-30] Use 1 as a minimum cache age when doing user initiated refresh



commit c2faf079cfd522b534fddc19d7d7e8bfe299edee
Author: Kalev Lember <klember redhat com>
Date:   Thu Oct 25 11:35:26 2018 +0200

    Use 1 as a minimum cache age when doing user initiated refresh
    
    It turns packagekit treats cache age of 0 as "unset", and changes it to
    G_MAXUINT ("never refresh") before passing it to backends. Fix this by
    just using 1 instead of 0 to force a minimum cache age.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1640701#c10

 plugins/packagekit/gs-plugin-packagekit-refresh.c | 4 ++--
 src/gs-updates-page.c                             | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/plugins/packagekit/gs-plugin-packagekit-refresh.c 
b/plugins/packagekit/gs-plugin-packagekit-refresh.c
index 64174fdd..993e3ce9 100644
--- a/plugins/packagekit/gs-plugin-packagekit-refresh.c
+++ b/plugins/packagekit/gs-plugin-packagekit-refresh.c
@@ -141,8 +141,8 @@ gs_plugin_refresh (GsPlugin *plugin,
        g_autoptr(GsApp) app_dl = gs_app_new (gs_plugin_get_name (plugin));
        g_autoptr(PkResults) results = NULL;
 
-       /* cache age of 0 is user-initiated */
-       pk_client_set_background (PK_CLIENT (priv->task), cache_age > 0);
+       /* cache age of 1 is user-initiated */
+       pk_client_set_background (PK_CLIENT (priv->task), cache_age > 1);
        pk_client_set_cache_age (PK_CLIENT (priv->task), cache_age);
 
        /* refresh the metadata */
diff --git a/src/gs-updates-page.c b/src/gs-updates-page.c
index 3922e275..f19f7dfb 100644
--- a/src/gs-updates-page.c
+++ b/src/gs-updates-page.c
@@ -811,7 +811,7 @@ gs_updates_page_get_new_updates (GsUpdatesPage *self)
 
        plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_REFRESH,
                                         "interactive", TRUE,
-                                        "age", (guint64) 0,
+                                        "age", (guint64) 1,
                                         NULL);
        gs_plugin_loader_job_process_async (self->plugin_loader, plugin_job,
                                            self->cancellable_refresh,


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