mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-10-06 13:11:32 +08:00
fix(edit-docs): fix random erase of attachments due to consistency issues
This commit is contained in:
parent
3a16bf59ef
commit
65d017390e
@ -28,9 +28,9 @@ async function main() {
|
|||||||
|
|
||||||
async function setOptions() {
|
async function setOptions() {
|
||||||
const optionsService = (await import("./src/services/options.js")).default;
|
const optionsService = (await import("./src/services/options.js")).default;
|
||||||
optionsService.setOption("eraseUnusedAttachmentsAfterSeconds", 600);
|
optionsService.setOption("eraseUnusedAttachmentsAfterSeconds", 10);
|
||||||
optionsService.setOption("eraseUnusedAttachmentsAfterTimeScale", 60);
|
optionsService.setOption("eraseUnusedAttachmentsAfterTimeScale", 60);
|
||||||
optionsService.setOption("compressImages", false);
|
optionsService.setOption("compressImages", "false");
|
||||||
}
|
}
|
||||||
|
|
||||||
async function createImportZip() {
|
async function createImportZip() {
|
||||||
|
@ -3,13 +3,15 @@ import fs from "fs/promises";
|
|||||||
import fsExtra from "fs-extra";
|
import fsExtra from "fs-extra";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
|
|
||||||
export async function initializeDatabase(customDbBuffer?: Buffer) {
|
export function initializeDatabase(customDbBuffer?: Buffer) {
|
||||||
const sqlInit = (await import("./src/services/sql_init.js")).default;
|
return new Promise<void>(async (resolve) => {
|
||||||
|
const sqlInit = (await import("./src/services/sql_init.js")).default;
|
||||||
cls.init(() => {
|
cls.init(async () => {
|
||||||
if (!sqlInit.isDbInitialized()) {
|
if (!sqlInit.isDbInitialized()) {
|
||||||
sqlInit.createInitialDatabase(true, customDbBuffer);
|
await sqlInit.createInitialDatabase(true, customDbBuffer);
|
||||||
}
|
}
|
||||||
|
resolve();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user