summaryrefslogtreecommitdiff
path: root/ext/bg/js/database.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-11-13 17:50:09 -0800
committerAlex Yatskov <alex@foosoft.net>2016-11-13 17:50:09 -0800
commit253da36755f24d656664ca524808e3292eef3697 (patch)
treef29c3e298803d8da241ea7f6585d4c9732305206 /ext/bg/js/database.js
parenta9eea9f63497f2fe829f5b8d1ecf6c58f18b2b79 (diff)
WIP
Diffstat (limited to 'ext/bg/js/database.js')
-rw-r--r--ext/bg/js/database.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/bg/js/database.js b/ext/bg/js/database.js
index 23041e40..5931e172 100644
--- a/ext/bg/js/database.js
+++ b/ext/bg/js/database.js
@@ -153,13 +153,14 @@ class Database {
}
return Promise.all([termCounter, kanjiCounter]).then(([termCount, kanjiCount]) => {
+ const rowLimit = 500;
const totalCount = termCount + kanjiCount;
let deletedCount = 0;
let termDeleter = Promise.resolve();
if (info.hasTerms) {
const termDeleterFunc = () => {
- return this.db.terms.where('dictionary').equals(title).limit(500).delete().then(count => {
+ return this.db.terms.where('dictionary').equals(title).limit(rowLimit).delete().then(count => {
if (count === 0) {
return Promise.resolve();
}
@@ -179,7 +180,7 @@ class Database {
let kanjiDeleter = Promise.resolve();
if (info.hasKanji) {
const kanjiDeleterFunc = () => {
- return this.db.kanji.where('dictionary').equals(title).limit(500).delete().then(count => {
+ return this.db.kanji.where('dictionary').equals(title).limit(rowLimit).delete().then(count => {
if (count === 0) {
return Promise.resolve();
}