Bug 551677 - Gloda could provide ability to force indexing of all messages in a folder, even non-dirty indexed ones. r=mixedpuppy. fixup for dropped callback after discussion with mixedpuppy.
authorAndrew Sutherland <asutherland@asutherland.org>
Tue, 16 Mar 2010 17:53:22 -0700
changeset 5189 defb1451fce4f30728c3d4160a2e7191cdb35e36
parent 5188 6417f114db07461d35db188054a2f41342f08cfe
child 5190 06c2c95bdcc6e66a46075717c1ab9c04a161dfa2
push idunknown
push userunknown
push dateunknown
reviewersmixedpuppy
bugs551677
Bug 551677 - Gloda could provide ability to force indexing of all messages in a folder, even non-dirty indexed ones. r=mixedpuppy. fixup for dropped callback after discussion with mixedpuppy.
mailnews/db/gloda/modules/index_msg.js
--- a/mailnews/db/gloda/modules/index_msg.js
+++ b/mailnews/db/gloda/modules/index_msg.js
@@ -1317,18 +1317,20 @@ var GlodaMsgIndexer = {
   /**
    * Index the contents of a folder.
    */
   _worker_folderIndex:
       function gloda_worker_folderIndex(aJob, aCallbackHandle) {
     let logDebug = this._log.level <= Log4Moz.Level.Debug;
     yield this._indexerEnterFolder(aJob.id);
 
-    if (!this.shouldIndexFolder(this._indexingFolder))
+    if (!this.shouldIndexFolder(this._indexingFolder)) {
+      aJob.safelyInvokeCallback(true);
       yield this.kWorkDone;
+    }
 
     // Make sure listeners get notified about this job.
     GlodaIndexer._notifyListeners();
 
     // there is of course a cost to all this header investigation even if we
     //  don't do something.  so we will yield with kWorkSync for every block.
     const HEADER_CHECK_SYNC_BLOCK_SIZE = this.HEADER_CHECK_SYNC_BLOCK_SIZE;
     const HEADER_CHECK_GC_BLOCK_SIZE = this.HEADER_CHECK_GC_BLOCK_SIZE;
@@ -1728,16 +1730,18 @@ var GlodaMsgIndexer = {
    * @param [aOptions.callback] A callback to invoke when the folder finishes
    *     indexing.  First argument is true if the task ran to completion
    *     successfully, false if we had to abort for some reason.
    * @param [aOptions.force=false] Should we force the indexing of all messages
    *     in the folder (true) or just index what hasn't been indexed (false).
    * @return true if we are going to index the folder, false if not.
    */
   indexFolder: function glodaIndexFolder(aMsgFolder, aOptions) {
+    if (!this.shouldIndexFolder(aMsgFolder))
+      return false;
     let glodaFolder = GlodaDatastore._mapFolder(aMsgFolder);
     // stay out of compacting/compacted folders
     if (glodaFolder.compacting || glodaFolder.compacted)
       return false;
 
     this._log.info("Queue-ing folder for indexing: " +
                    aMsgFolder.prettiestName);
     let job = new IndexingJob("folder", glodaFolder.id);