Bug 888784 - Make FormHistory.expireOldEntries use new Sqlite.jsm database backend. r?mak
MozReview-Commit-ID: KSaWz0s6hF1
--- a/toolkit/components/satchel/FormHistory.jsm
+++ b/toolkit/components/satchel/FormHistory.jsm
@@ -862,23 +862,22 @@ function expireOldEntriesDeletion(aExpir
* @param {number} aBeginningCount number of entries at first
*/
function expireOldEntriesVacuum(aExpireTime, aBeginningCount) {
FormHistory.count({}, {
handleResult(aEndingCount) {
if (aBeginningCount - aEndingCount > 500) {
log("expireOldEntriesVacuum");
- let stmt = dbCreateAsyncStatement("VACUUM");
- stmt.executeAsync({
- handleResult: NOOP,
- handleError(aError) {
+ FormHistory.db.then(async conn => {
+ try {
+ await conn.executeCached("VACUUM");
+ } catch (e) {
log("expireVacuumError");
- },
- handleCompletion: NOOP,
+ }
});
}
sendNotification("formhistory-expireoldentries", aExpireTime);
},
handleError(aError) {
log("expireEndCountFailure");
},