fix: optimize DB pull (#2589)

This commit is contained in:
Peng Xiao
2023-05-31 11:09:18 +08:00
committed by Himself65
parent e4ba72853d
commit 4abe62c9e0
17 changed files with 619 additions and 40 deletions

View File

@@ -178,7 +178,7 @@ const createSQLiteProvider = (
async function syncBlobIntoSQLite(bs: BlobManager) {
const persistedKeys = await apis.db.getBlobKeys(blockSuiteWorkspace.id);
const allKeys = await bs.list();
const allKeys = await bs.list().catch(() => []);
const keysToPersist = allKeys.filter(k => !persistedKeys.includes(k));
logger.info('persisting blobs', keysToPersist, 'to sqlite');