Fix: partial one-time bucket download

This commit is contained in:
Christoph Wiechert
2017-05-08 15:08:15 +02:00
parent 1c3849e255
commit 293497c23d

View File

@@ -102,7 +102,7 @@ module.exports = class DB {
if(!this.initialized) throw new Error('DB not initialized'); if(!this.initialized) throw new Error('DB not initialized');
debug(`Remove ${sid}++${key}`); debug(`Remove ${sid}++${key}`);
await this.store.del(sid + '++' + key); await this.store.del(sid + '++' + key);
const i = this.get(sid).find(item => item.key === key); const i = this.db[sid].findIndex(item => item.key === key);
this.get(sid).splice(i, 1); this.get(sid).splice(i, 1);
if(this.get(sid).length === 0) { if(this.get(sid).length === 0) {
delete this.db[sid]; delete this.db[sid];