Bug 480381 - "lastsync" pref is sometimes a number and sometimes a string
authorEdward Lee <edward.lee@engineering.uiuc.edu>
Thu, 26 Feb 2009 12:34:54 -0800
changeset 45299 da99923082c1b0f13e97e4776446999289cefdd7
parent 45298 ddcbab9f793eb023b9f88cd30c2602ad2d3d8436
child 45300 b5561e413cc1d9d18f42bb86e162002ec0762f30
push idunknown
push userunknown
push dateunknown
bugs480381
Bug 480381 - "lastsync" pref is sometimes a number and sometimes a string
services/sync/modules/service.js
--- a/services/sync/modules/service.js
+++ b/services/sync/modules/service.js
@@ -692,18 +692,17 @@ WeaveSvc.prototype = {
 
 	if (!(yield this._syncEngine.async(this, self.cb, engine))) {
 	  this._log.info("Aborting sync");
 	  break;
 	}
       }
 
       if (!this._syncError) {
-	Svc.Prefs.reset("lastsync");
-	Svc.Prefs.set("lastsync", new Date().toString());
+	Svc.Prefs.set("lastSync", new Date().toString());
 	this._log.info("Sync completed successfully");
       } else
         this._log.warn("Some engines did not sync correctly");
 
     } finally {
       this.cancelRequested = false;
       this._syncError = false;
     }
@@ -770,18 +769,17 @@ WeaveSvc.prototype = {
           // reset the threshold to the initial value, and start over again).
           this._syncThresholds[engine.name] -= THRESHOLD_DECREMENT_STEP;
           if (this._syncThresholds[engine.name] <= 0)
             this._syncThresholds[engine.name] = 1;
         }
       }
 
       if (!this._syncError) {
-	Svc.Prefs.reset("lastsync");
-	Svc.Prefs.set("lastsync", Date.now());
+	Svc.Prefs.set("lastSync", new Date().toString());
         this._log.info("Sync completed successfully");
       } else
         this._log.warn("Some engines did not sync correctly");
 
     } finally {
       this._cancelRequested = false;
       this._syncError = false;
     }