[gnome-software: 1/10] flatpak: Use 64-bit cache ages




commit fda6770ffb109740eeb0f72c9b2bdaff26081fbf
Author: Philip Withnall <pwithnall endlessos org>
Date:   Thu Jan 27 19:39:59 2022 +0000

    flatpak: Use 64-bit cache ages
    
    This makes the plugin consistent with cache age handling through the
    rest of gnome-software.
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>
    
    Helps: #1472

 plugins/flatpak/gs-flatpak.c | 12 +++++++-----
 plugins/flatpak/gs-flatpak.h |  2 +-
 2 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/plugins/flatpak/gs-flatpak.c b/plugins/flatpak/gs-flatpak.c
index a3f3b003e..7b9fdd2d6 100644
--- a/plugins/flatpak/gs-flatpak.c
+++ b/plugins/flatpak/gs-flatpak.c
@@ -1184,8 +1184,10 @@ gs_flatpak_refresh_appstream_remote (GsFlatpak *self,
 }
 
 static gboolean
-gs_flatpak_refresh_appstream (GsFlatpak *self, guint cache_age,
-                             GCancellable *cancellable, GError **error)
+gs_flatpak_refresh_appstream (GsFlatpak     *self,
+                              guint64        cache_age_secs,
+                              GCancellable  *cancellable,
+                              GError       **error)
 {
        gboolean ret;
        g_autoptr(GPtrArray) xremotes = NULL;
@@ -1226,7 +1228,7 @@ gs_flatpak_refresh_appstream (GsFlatpak *self, guint cache_age,
                /* is the timestamp new enough */
                file_timestamp = flatpak_remote_get_appstream_timestamp (xremote, NULL);
                tmp = gs_utils_get_file_age (file_timestamp);
-               if (tmp < cache_age) {
+               if (tmp < cache_age_secs) {
                        g_autofree gchar *fn = g_file_get_path (file_timestamp);
                        g_debug ("%s is only %u seconds old, so ignoring refresh",
                                 fn, tmp);
@@ -1893,7 +1895,7 @@ gs_flatpak_add_updates (GsFlatpak *self, GsAppList *list,
 
 gboolean
 gs_flatpak_refresh (GsFlatpak *self,
-                   guint cache_age,
+                   guint64 cache_age_secs,
                    GCancellable *cancellable,
                    GError **error)
 {
@@ -1922,7 +1924,7 @@ gs_flatpak_refresh (GsFlatpak *self,
        g_rw_lock_reader_unlock (&self->silo_lock);
 
        /* update AppStream metadata */
-       if (!gs_flatpak_refresh_appstream (self, cache_age, cancellable, error))
+       if (!gs_flatpak_refresh_appstream (self, cache_age_secs, cancellable, error))
                return FALSE;
 
        /* ensure valid */
diff --git a/plugins/flatpak/gs-flatpak.h b/plugins/flatpak/gs-flatpak.h
index ed27f79b5..4eb9ce7b6 100644
--- a/plugins/flatpak/gs-flatpak.h
+++ b/plugins/flatpak/gs-flatpak.h
@@ -49,7 +49,7 @@ gboolean      gs_flatpak_add_updates          (GsFlatpak              *self,
                                                 GCancellable           *cancellable,
                                                 GError                 **error);
 gboolean       gs_flatpak_refresh              (GsFlatpak              *self,
-                                                guint                   cache_age,
+                                                guint64                 cache_age_secs,
                                                 GCancellable           *cancellable,
                                                 GError                 **error);
 gboolean       gs_flatpak_refine_app           (GsFlatpak              *self,


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