Bug 1197625 - delay sync on wake for 5 seconds in the hope the network is back up by then. r=rnewman
authorMark Hammond <mhammond@skippinet.com.au>
Thu, 12 Nov 2015 10:54:55 +1100
changeset 308413 6eb43418296a30fe5e1ca7482d4efbdcae740397
parent 308412 dd627c83397a2be0216a881e6a58e5f5f5675cdd
child 308414 eb6f5d7eeeae1ddaf23b7a4fea1662b56e7aacdc
push id7470
push users.kaspari@gmail.com
push dateThu, 12 Nov 2015 12:51:02 +0000
reviewersrnewman
bugs1197625
milestone45.0a1
Bug 1197625 - delay sync on wake for 5 seconds in the hope the network is back up by then. r=rnewman
services/sync/modules/policies.js
--- a/services/sync/modules/policies.js
+++ b/services/sync/modules/policies.js
@@ -267,20 +267,21 @@ SyncScheduler.prototype = {
           if (this.numClients > 1) {
             this.scheduleNextSync(0);
           }
         }, IDLE_OBSERVER_BACK_DELAY, this, "idleDebouncerTimer");
         break;
       case "wake_notification":
         this._log.debug("Woke from sleep.");
         Utils.nextTick(() => {
-          // Trigger a sync if we have multiple clients.
+          // Trigger a sync if we have multiple clients. We give it 5 seconds
+          // incase the network is still in the process of coming back up.
           if (this.numClients > 1) {
-            this._log.debug("More than 1 client. Syncing.");
-            this.scheduleNextSync(0);
+            this._log.debug("More than 1 client. Will sync in 5s.");
+            this.scheduleNextSync(5000);
           }
         });
         break;
     }
   },
 
   adjustSyncInterval: function adjustSyncInterval() {
     if (Status.eol) {