Bug 1507429 - Reuse flush() in AddonRepository save();r=aswan
authorJulian Descottes <jdescottes@mozilla.com>
Thu, 29 Nov 2018 06:27:52 +0000
changeset 505119 35b5e6295787c4e5907dc502eef3c602969941d2
parent 505118 de0f2f6fd5b3b2784355b64243ce846a328b5883
child 505120 19475486e59680b67779fcf4c95a004e4c88d02f
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaswan
bugs1507429
milestone65.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 1507429 - Reuse flush() in AddonRepository save();r=aswan Depends on D12328. Try at https://treeherder.mozilla.org/#/jobs?repo=try&selectedJob=214469423&revision=0ac74e46d2d8b4a72ad6dd170b8170cff900ab43 Differential Revision: https://phabricator.services.mozilla.com/D13337
toolkit/mozapps/extensions/internal/AddonRepository.jsm
--- a/toolkit/mozapps/extensions/internal/AddonRepository.jsm
+++ b/toolkit/mozapps/extensions/internal/AddonRepository.jsm
@@ -966,24 +966,17 @@ var AddonDatabase = {
   },
 
   save() {
     if (!this._saveTask) {
       this._saveTask = new DeferredTask(() => this._saveNow(), DB_BATCH_TIMEOUT_MS);
 
       if (!this._blockerAdded) {
         AsyncShutdown.profileBeforeChange.addBlocker(
-          "Flush AddonRepository",
-          async () => {
-            if (!this._saveTask) {
-              return;
-            }
-            await this._saveTask.finalize();
-            this._saveTask = null;
-          });
+          "Flush AddonRepository", () => this.flush());
         this._blockerAdded = true;
       }
     }
     this._saveTask.arm();
   },
 
   /**
    * Flush any pending I/O on the addons.json file