You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-06-15 23:00:36 +02:00
* Speed up Linux Sync with KeepAlive Client * Tidying up * eslint * Fix Breaking of building mobile client * Refactor to make building on android possible * Coding Convention * Update shim-init-node.js Co-authored-by: Laurent Cozic <laurent22@users.noreply.github.com>
This commit is contained in:
@ -9,6 +9,8 @@ const Note = require('lib/models/Note.js');
|
||||
const Resource = require('lib/models/Resource.js');
|
||||
const urlValidator = require('valid-url');
|
||||
const { _ } = require('lib/locale.js');
|
||||
const http = require('http');
|
||||
const https = require('https');
|
||||
|
||||
function shimInit() {
|
||||
shim.fsDriver = () => {
|
||||
@ -363,6 +365,24 @@ function shimInit() {
|
||||
return bridge().openExternal(url);
|
||||
};
|
||||
|
||||
shim.httpAgent_ = null;
|
||||
|
||||
shim.httpAgent = url => {
|
||||
if (shim.isLinux() && !shim.httpAgent) {
|
||||
var AgentSettings = {
|
||||
keepAlive: true,
|
||||
maxSockets: 1,
|
||||
keepAliveMsecs: 5000,
|
||||
};
|
||||
if (url.startsWith('https')) {
|
||||
shim.httpAgent_ = new https.Agent(AgentSettings);
|
||||
} else {
|
||||
shim.httpAgent_ = new http.Agent(AgentSettings);
|
||||
}
|
||||
}
|
||||
return shim.httpAgent_;
|
||||
};
|
||||
|
||||
shim.openOrCreateFile = (filepath, defaultContents) => {
|
||||
// If the file doesn't exist, create it
|
||||
if (!fs.existsSync(filepath)) {
|
||||
|
Reference in New Issue
Block a user