Bug 1266783 - prevent the search cache file from being flushed twice in a row after a re-initialization, r=adw. a=ritu
authorFlorian Quèze <florian@queze.net>
Fri, 29 Apr 2016 17:08:55 +0200
changeset 332653 039a5532ac6fe812463eca31147609a329f81e78
parent 332652 2817a27cf29b6c1495b1730cc2f643d6b3e17e17
child 332654 2c8eaa40328465c2905194a57a5d6c6cd90067c2
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersadw, ritu
bugs1266783
milestone48.0a2
Bug 1266783 - prevent the search cache file from being flushed twice in a row after a re-initialization, r=adw. a=ritu MozReview-Commit-ID: 4sftx4M1WSy
toolkit/components/search/nsSearchService.js
--- a/toolkit/components/search/nsSearchService.js
+++ b/toolkit/components/search/nsSearchService.js
@@ -2839,16 +2839,19 @@ SearchService.prototype = {
     return this.getEngineByName(defaultEngine);
   },
 
   resetToOriginalDefaultEngine: function SRCH_SVC__resetToOriginalDefaultEngine() {
     this.currentEngine = this._originalDefaultEngine;
   },
 
   _buildCache: function SRCH_SVC__buildCache() {
+    if (this._batchTask)
+      this._batchTask.disarm();
+
     TelemetryStopwatch.start("SEARCH_SERVICE_BUILD_CACHE_MS");
     let cache = {};
     let locale = getLocale();
     let buildID = Services.appinfo.platformBuildID;
 
     // Allows us to force a cache refresh should the cache format change.
     cache.version = CACHE_VERSION;
     // We don't want to incur the costs of stat()ing each plugin on every