- Now storing files after cleaning up is correct works.

Improved:
- Cleaning the local database up got incredibly fastened.
This commit is contained in:
vorotamoroz
2023-07-26 17:31:55 +09:00
parent 7607be7729
commit 9d68025f2a
4 changed files with 9 additions and 1 deletions

2
package-lock.json generated
View File

@@ -36,8 +36,10 @@
"pouchdb-adapter-idb": "^8.0.1", "pouchdb-adapter-idb": "^8.0.1",
"pouchdb-adapter-indexeddb": "^8.0.1", "pouchdb-adapter-indexeddb": "^8.0.1",
"pouchdb-core": "^8.0.1", "pouchdb-core": "^8.0.1",
"pouchdb-errors": "^8.0.1",
"pouchdb-find": "^8.0.1", "pouchdb-find": "^8.0.1",
"pouchdb-mapreduce": "^8.0.1", "pouchdb-mapreduce": "^8.0.1",
"pouchdb-merge": "^8.0.1",
"pouchdb-replication": "^8.0.1", "pouchdb-replication": "^8.0.1",
"pouchdb-utils": "^8.0.1", "pouchdb-utils": "^8.0.1",
"svelte": "^3.59.1", "svelte": "^3.59.1",

View File

@@ -36,6 +36,8 @@
"pouchdb-core": "^8.0.1", "pouchdb-core": "^8.0.1",
"pouchdb-find": "^8.0.1", "pouchdb-find": "^8.0.1",
"pouchdb-mapreduce": "^8.0.1", "pouchdb-mapreduce": "^8.0.1",
"pouchdb-merge": "^8.0.1",
"pouchdb-errors": "^8.0.1",
"pouchdb-replication": "^8.0.1", "pouchdb-replication": "^8.0.1",
"pouchdb-utils": "^8.0.1", "pouchdb-utils": "^8.0.1",
"svelte": "^3.59.1", "svelte": "^3.59.1",

Submodule src/lib updated: ca61c5a64b...1a5cac6d65

View File

@@ -1656,10 +1656,12 @@ Even if you choose to clean up, you will see this option again if you exit Obsid
} }
await purgeUnreferencedChunks(this.localDatabase.localDatabase, false); await purgeUnreferencedChunks(this.localDatabase.localDatabase, false);
this.localDatabase.hashCaches.clear();
// Perform the synchronisation once. // Perform the synchronisation once.
if (await this.replicator.openReplication(this.settings, false, showMessage, true)) { if (await this.replicator.openReplication(this.settings, false, showMessage, true)) {
await balanceChunkPurgedDBs(this.localDatabase.localDatabase, remoteDB.db); await balanceChunkPurgedDBs(this.localDatabase.localDatabase, remoteDB.db);
await purgeUnreferencedChunks(this.localDatabase.localDatabase, false); await purgeUnreferencedChunks(this.localDatabase.localDatabase, false);
this.localDatabase.hashCaches.clear();
await this.getReplicator().markRemoteResolved(this.settings); await this.getReplicator().markRemoteResolved(this.settings);
Logger("The local database has been cleaned up.", showMessage ? LOG_LEVEL.NOTICE : LOG_LEVEL.INFO) Logger("The local database has been cleaned up.", showMessage ? LOG_LEVEL.NOTICE : LOG_LEVEL.INFO)
} else { } else {
@@ -2552,6 +2554,7 @@ Or if you are sure know what had been happened, we can unlock the database from
} }
await purgeUnreferencedChunks(remoteDBConn.db, true, this.settings, false); await purgeUnreferencedChunks(remoteDBConn.db, true, this.settings, false);
await purgeUnreferencedChunks(this.localDatabase.localDatabase, true); await purgeUnreferencedChunks(this.localDatabase.localDatabase, true);
this.localDatabase.hashCaches.clear();
}); });
} }
@@ -2566,6 +2569,7 @@ Or if you are sure know what had been happened, we can unlock the database from
} }
await purgeUnreferencedChunks(remoteDBConn.db, false, this.settings, true); await purgeUnreferencedChunks(remoteDBConn.db, false, this.settings, true);
await purgeUnreferencedChunks(this.localDatabase.localDatabase, false); await purgeUnreferencedChunks(this.localDatabase.localDatabase, false);
this.localDatabase.hashCaches.clear();
await balanceChunkPurgedDBs(this.localDatabase.localDatabase, remoteDBConn.db); await balanceChunkPurgedDBs(this.localDatabase.localDatabase, remoteDBConn.db);
this.localDatabase.refreshSettings(); this.localDatabase.refreshSettings();
Logger("The remote database has been cleaned up! Other devices will be cleaned up on the next synchronisation.") Logger("The remote database has been cleaned up! Other devices will be cleaned up on the next synchronisation.")