Move, rename and document property
This commit is contained in:
parent
29d947cd6d
commit
d019d7ae9f
3 changed files with 14 additions and 4 deletions
|
|
@ -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.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue