[geary: 62/66] Move queueing of idle garbage collection to calling method
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary: 62/66] Move queueing of idle garbage collection to calling method
- Date: Tue, 30 Jun 2020 07:12:52 +0000 (UTC)
commit 2049d7aa6b0bfe768c3768bb7a1a7e5579769d29
Author: Chris Heywood <15127-creywood users noreply gitlab gnome org>
Date: Mon May 18 17:57:13 2020 +1000
Move queueing of idle garbage collection to calling method
.../imap-engine-account-synchronizer.vala | 22 +++++++++-------------
1 file changed, 9 insertions(+), 13 deletions(-)
---
diff --git a/src/engine/imap-engine/imap-engine-account-synchronizer.vala
b/src/engine/imap-engine/imap-engine-account-synchronizer.vala
index f175ceea3..d9b28cb7e 100644
--- a/src/engine/imap-engine/imap-engine-account-synchronizer.vala
+++ b/src/engine/imap-engine/imap-engine-account-synchronizer.vala
@@ -51,7 +51,6 @@ private class Geary.ImapEngine.AccountSynchronizer :
bool for_storage_clean=false,
GarbageCollectPostIdleMessageDetach? post_idle_detach_op=null) {
- bool add_post_idle_detach_op = false;
foreach (Folder folder in folders) {
// Only sync folders that:
// 1. Can actually be opened (i.e. are selectable)
@@ -77,9 +76,6 @@ private class Geary.ImapEngine.AccountSynchronizer :
post_idle_detach_op
);
op = check_op;
- if (post_idle_detach_op != null) {
- add_post_idle_detach_op = true;
- }
} else {
op = new RefreshFolderSync(this.account, imap_folder);
}
@@ -91,15 +87,6 @@ private class Geary.ImapEngine.AccountSynchronizer :
}
}
}
-
- // Add GC operation after message removal during background cleanup
- if (add_post_idle_detach_op) {
- try {
- this.account.queue_operation(post_idle_detach_op);
- } catch (Error err) {
- warning("Failed to queue sync operation: %s", err.message);
- }
- }
}
private void do_prefetch_changed() {
@@ -117,13 +104,22 @@ private class Geary.ImapEngine.AccountSynchronizer :
this.background_idle_gc_scheduled = true;
GarbageCollectPostIdleMessageDetach op =
new GarbageCollectPostIdleMessageDetach(account);
+
op.completed.connect(() => {
this.background_idle_gc_scheduled = false;
});
cancellable.cancelled.connect(() => {
this.background_idle_gc_scheduled = false;
});
+
send_all(this.account.list_folders(), false, true, op);
+
+ // Add GC operation after message removal during background cleanup
+ try {
+ this.account.queue_operation(op);
+ } catch (Error err) {
+ warning("Failed to queue sync operation: %s", err.message);
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]