[geary: 22/66] Move, rename and document property



commit d019d7ae9f0d97b4eea4f94c8808f59b4ca6fdb8
Author: Chris Heywood <15127-creywood users noreply gitlab gnome org>
Date:   Thu Jan 9 13:00:52 2020 +0100

    Move, rename and document property

 src/engine/api/geary-account-information.vala           |  2 --
 src/engine/api/geary-account.vala                       | 12 ++++++++++++
 src/engine/imap-engine/imap-engine-generic-account.vala |  4 ++--
 3 files changed, 14 insertions(+), 4 deletions(-)
---
diff --git a/src/engine/api/geary-account-information.vala b/src/engine/api/geary-account-information.vala
index 60c42e7ab..6c8c06f27 100644
--- a/src/engine/api/geary-account-information.vala
+++ b/src/engine/api/geary-account-information.vala
@@ -210,8 +210,6 @@ public class Geary.AccountInformation : BaseObject {
         default = new Gee.LinkedList<Geary.RFC822.MailboxAddress>();
     }
 
-    public DateTime? last_backgrounded_cleanup_time { get; set; default = null; }
-
     /**
      * Emitted when a service has reported an authentication failure.
      *
diff --git a/src/engine/api/geary-account.vala b/src/engine/api/geary-account.vala
index d9100c1cf..5e2641b47 100644
--- a/src/engine/api/geary-account.vala
+++ b/src/engine/api/geary-account.vala
@@ -145,6 +145,18 @@ public abstract class Geary.Account : BaseObject, Logging.Source {
     public ProgressMonitor db_upgrade_monitor { get; protected set; }
     public ProgressMonitor db_vacuum_monitor { get; protected set; }
 
+    /**
+     * The last time the account storage was cleaned.
+     *
+     * This does not imply that a full reap plus vacuum garbage
+     * collection (GC) is performed, merely that:
+     * 1. Any old messages are removed
+     * 2. If any old messages were removed, or the defined period
+     * (in ImapDB.GC) has past, a GC reap is performed
+     * 3. GC vacuum is run if recommended
+     */
+    public DateTime? last_storage_cleanup { get; set; default = null; }
+
 
     public signal void opened();
 
diff --git a/src/engine/imap-engine/imap-engine-generic-account.vala 
b/src/engine/imap-engine/imap-engine-generic-account.vala
index dc8ade268..a6b4f2d5e 100644
--- a/src/engine/imap-engine/imap-engine-generic-account.vala
+++ b/src/engine/imap-engine/imap-engine-generic-account.vala
@@ -535,12 +535,12 @@ private abstract class Geary.ImapEngine.GenericAccount : Geary.Account {
         debug("Backgrounded cleanup check for %s account", this.information.display_name);
 
         DateTime now = new DateTime.now_local();
-        DateTime? last_cleanup = this.information.last_backgrounded_cleanup_time;
+        DateTime? last_cleanup = this.last_storage_cleanup;
 
         if (last_cleanup == null ||
             (now.difference(last_cleanup) / TimeSpan.MINUTE > 
APP_BACKGROUNDED_CLEANUP_WORK_INTERVAL_MINUTES)) {
             // Interval check is OK, start by detaching old messages
-            this.information.last_backgrounded_cleanup_time = now;
+            this.last_storage_cleanup = now;
             this.old_messages_background_cleanup_request(cancellable);
         } else if (local.db.want_background_vacuum) {
             // Vacuum has been flagged as needed, run it


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