perf improvement for db cleanup

hashtags
Nolan Lawson 2018-01-19 21:51:22 -08:00
rodzic 0dbfbcf0f2
commit 9bb9632913
2 zmienionych plików z 4 dodań i 1 usunięć

Wyświetl plik

@ -14,6 +14,9 @@ async function cleanup(instanceName, timeline) {
store.count().onsuccess = (e) => {
let count = e.target.result
if (count <= MAX_NUM_STORED_STATUSES) {
return
}
let openKeyCursor = index.openKeyCursor || index.openCursor
openKeyCursor.call(index, null, 'prev').onsuccess = (e) => {
let cursor = e.target.result

Wyświetl plik

@ -1,5 +1,5 @@
import { cleanupOldStatuses } from './cleanup'
import { OBJECT_STORE, getDatabase, doTransaction } from './shared'
import { OBJECT_STORE, getDatabase } from './shared'
import { toReversePaddedBigInt, transformStatusForStorage } from './utils'
export async function getTimeline(instanceName, timeline, maxId = null, limit = 20) {