[geary/wip/778276-better-flag-updates] Prevent the email prefetcher running multiple times.



commit 70e7ae279f574065ed2283c9410f556d980b542b
Author: Michael James Gratton <mike vee net>
Date:   Wed Dec 20 20:54:32 2017 +1030

    Prevent the email prefetcher running multiple times.
    
    * src/engine/imap-engine/imap-engine-minimal-folder.vala (MinimalFolder):
      Tell the prefetcher we've opened once the open count as incremented,
      rather than when the remote is connected, so it isn't signalled
      multiple times and hence doesn't add multiple listeners.

 .../imap-engine/imap-engine-minimal-folder.vala    |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/engine/imap-engine/imap-engine-minimal-folder.vala 
b/src/engine/imap-engine/imap-engine-minimal-folder.vala
index d0bdccd..1086375 100644
--- a/src/engine/imap-engine/imap-engine-minimal-folder.vala
+++ b/src/engine/imap-engine/imap-engine-minimal-folder.vala
@@ -594,6 +594,9 @@ private class Geary.ImapEngine.MinimalFolder : Geary.Folder, Geary.FolderSupport
 
         this.open_cancellable = new Cancellable();
 
+        // Notify the email prefetcher
+        this.email_prefetcher.open();
+
         // Unless NO_DELAY is set, do NOT open the remote side here; wait for the ReplayQueue to
         // require a remote connection or wait_for_open_async() to be called ... this allows for
         // fast local-only operations to occur, local-only either because (a) the folder has all
@@ -811,9 +814,6 @@ private class Geary.ImapEngine.MinimalFolder : Geary.Folder, Geary.FolderSupport
         
         _properties.add(remote_folder.properties);
 
-        // Now that the remote is open, update messages.
-        this.email_prefetcher.open();
-
         // notify any subscribers with similar information
         notify_opened(Geary.Folder.OpenState.BOTH, remote_count);
     }


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