Bug 739801: Initialize the lastUpdateTime to 0 to make sure we check for an update on first startup after a fresh install (or profile clear). r=rs
authorChris Jones <jones.chris.g@gmail.com>
Tue, 10 Apr 2012 01:55:10 -0700
changeset 94616 dd6f8d1c7fe9705a85ea0560cfcd4c08d5b88171
parent 94615 80bbc7983052fb7c4d798029e7ee81fd4451f3d1
child 94617 54243c5a85285c399202fca5eb9eb0de1d2a9291
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrs
bugs739801
milestone14.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 739801: Initialize the lastUpdateTime to 0 to make sure we check for an update on first startup after a fresh install (or profile clear). r=rs
toolkit/mozapps/update/nsUpdateTimerManager.js
--- a/toolkit/mozapps/update/nsUpdateTimerManager.js
+++ b/toolkit/mozapps/update/nsUpdateTimerManager.js
@@ -216,17 +216,19 @@ TimerManager.prototype = {
 
       let interval = getPref("getIntPref", prefInterval, defaultInterval);
       let prefLastUpdate = PREF_APP_UPDATE_LASTUPDATETIME_FMT.replace(/%ID%/,
                                                                   timerID);
       if (Services.prefs.prefHasUserValue(prefLastUpdate)) {
         lastUpdateTime = Services.prefs.getIntPref(prefLastUpdate);
       }
       else {
-        lastUpdateTime = now;
+        // Initialize the last update time to 0 so that we check for
+        // an update the first time the interval expires.
+        lastUpdateTime = 0;
         Services.prefs.setIntPref(prefLastUpdate, lastUpdateTime);
       }
 
       tryFire(function() {
         try {
           Components.classes[cid][method](Ci.nsITimerCallback).notify(timer);
           LOG("TimerManager:notify - notified " + cid);
         }