1
0
mirror of https://github.com/vrtmrz/obsidian-livesync.git synced 2025-01-20 18:28:20 +02:00
- Case-insensitive file handling
    - Full-lower-case files are no longer created during database checking.
  - Bulk chunk transfer
    - The default value will automatically adjust to an acceptable size when using IBM Cloudant.
This commit is contained in:
vorotamoroz 2024-09-08 17:55:04 +09:00
parent 3285c1694b
commit 7eae25edd0
2 changed files with 20 additions and 7 deletions

@ -1 +1 @@
Subproject commit c9af24ecd6457f23e8fd3c454b7621a70742399b
Subproject commit 633af447d24339718d0f6e16e950a124b46b3896

View File

@ -688,6 +688,17 @@ ___However, to enable either of these changes, both remote and local databases n
await this.performAppReload();
}
async migrateCheckBulkSize() {
if (this.settings.sendChunksBulk) {
if (this.settings.couchDB_URI != "" && isCloudantURI(this.settings.couchDB_URI)) {
if (this.settings.sendChunksBulkMaxSize > 1) {
Logger("Cloudant does not support bulk size more than 1MB, Automatically fixed", LOG_LEVEL_NOTICE);
this.settings.sendChunksBulkMaxSize = 1;
await this.saveSettings();
}
}
}
}
async migrationCheck() {
const old = this.settings.settingVersion;
const current = SETTING_VERSION_SUPPORT_CASE_INSENSITIVE;
@ -2687,25 +2698,27 @@ Or if you are sure know what had been happened, we can unlock the database from
const file = storageFileNameMap[storageFileNameCI2CS[e]];
if (!this.isFileSizeExceeded(file.stat.size)) {
await this.updateIntoDB(file);
fireAndForget(() => this.checkAndApplySettingFromMarkdown(e, true));
const path = getPathFromTFile(file);
fireAndForget(() => this.checkAndApplySettingFromMarkdown(path, true));
} else {
Logger(`UPDATE DATABASE: ${e} has been skipped due to file size exceeding the limit`, logLevel);
}
}));
initProcess.push(runAll("UPDATE STORAGE", filesExistOnlyInDatabase, async (e) => {
const w = databaseFileNameMap[databaseFileNameCI2CS[e]];
const path = getPath(w) ?? e;
if (w && !(w.deleted || w._deleted)) {
if (!this.isFileSizeExceeded(w.size)) {
await this.pullFile(e, undefined, false, undefined, false);
await this.pullFile(path, undefined, false, undefined, false);
fireAndForget(() => this.checkAndApplySettingFromMarkdown(e, true));
Logger(`Check or pull from db:${e} OK`);
Logger(`Check or pull from db:${path} OK`);
} else {
Logger(`UPDATE STORAGE: ${e} has been skipped due to file size exceeding the limit`, logLevel);
Logger(`UPDATE STORAGE: ${path} has been skipped due to file size exceeding the limit`, logLevel);
}
} else if (w) {
Logger(`Deletion history skipped: ${e}`, LOG_LEVEL_VERBOSE);
Logger(`Deletion history skipped: ${path}`, LOG_LEVEL_VERBOSE);
} else {
Logger(`entry not found: ${e}`);
Logger(`entry not found: ${path}`);
}
}));