mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 03:46:37 +01:00
reddit plugin configuration from file, not from options now. Scheduling, refactoring of sync mutex
This commit is contained in:
@@ -20,25 +20,25 @@ let proxyToggle = true;
|
||||
let syncServerCertificate = null;
|
||||
|
||||
async function sync() {
|
||||
const releaseMutex = await sync_mutex.acquire();
|
||||
|
||||
try {
|
||||
if (!await sql.isDbUpToDate()) {
|
||||
return {
|
||||
success: false,
|
||||
message: "DB not up to date"
|
||||
};
|
||||
}
|
||||
await sync_mutex.doExclusively(async () => {
|
||||
if (!await sql.isDbUpToDate()) {
|
||||
return {
|
||||
success: false,
|
||||
message: "DB not up to date"
|
||||
};
|
||||
}
|
||||
|
||||
const syncContext = await login();
|
||||
const syncContext = await login();
|
||||
|
||||
await pushSync(syncContext);
|
||||
await pushSync(syncContext);
|
||||
|
||||
await pullSync(syncContext);
|
||||
await pullSync(syncContext);
|
||||
|
||||
await pushSync(syncContext);
|
||||
await pushSync(syncContext);
|
||||
|
||||
await checkContentHash(syncContext);
|
||||
await checkContentHash(syncContext);
|
||||
});
|
||||
|
||||
return {
|
||||
success: true
|
||||
@@ -64,9 +64,6 @@ async function sync() {
|
||||
}
|
||||
}
|
||||
}
|
||||
finally {
|
||||
releaseMutex();
|
||||
}
|
||||
}
|
||||
|
||||
async function login() {
|
||||
|
||||
Reference in New Issue
Block a user