1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-23 22:36:32 +02:00

All, Server: Add support for faster built-in sync locks (#5662)

This commit is contained in:
Laurent
2021-11-03 12:26:26 +00:00
committed by GitHub
parent 630a400181
commit 47a31c4ef1
19 changed files with 675 additions and 181 deletions

View File

@@ -142,7 +142,7 @@ export default class JoplinServerApi {
}
if (sessionId) headers['X-API-AUTH'] = sessionId;
headers['X-API-MIN-VERSION'] = '2.1.4';
headers['X-API-MIN-VERSION'] = '2.6.0'; // Need server 2.6 for new lock support
const fetchOptions: any = {};
fetchOptions.headers = headers;
@@ -253,8 +253,12 @@ export default class JoplinServerApi {
const output = await loadResponseJson();
return output;
} catch (error) {
if (error.code !== 404) {
// Don't print error info for file not found (handled by the
// driver), or lock-acquisition errors because it's handled by
// LockHandler.
if (![404, 'hasExclusiveLock', 'hasSyncLock'].includes(error.code)) {
logger.warn(this.requestToCurl_(url, fetchOptions));
logger.warn('Code:', error.code);
logger.warn(error);
}