Merge branch 'staging' into exportFolderTests

This commit is contained in:
ClemDee
2019-08-14 15:59:59 +02:00
2 changed files with 8 additions and 0 deletions

View File

@@ -21,6 +21,11 @@ define([
S.leave(); S.leave();
} catch (e) { console.log(e); } } catch (e) { console.log(e); }
} }
if (S.session && S.session.stop) {
try {
S.session.stop();
} catch (e) { console.error(e); }
}
var abort = Util.find(S, ['session', 'realtime', 'abort']); var abort = Util.find(S, ['session', 'realtime', 'abort']);
if (typeof(abort) === 'function') { if (typeof(abort) === 'function') {
S.session.realtime.sync(); S.session.realtime.sync();

View File

@@ -864,6 +864,9 @@ define([
Cryptpad.removeLoginBlock(data, cb); Cryptpad.removeLoginBlock(data, cb);
}); });
// It seems we have performance issues when we open and close a lot of channels over
// the same network, maybe a memory leak. To fix this, we kill and create a new
// network every 30 cryptget calls (1 call = 1 channel)
var cgNetwork; var cgNetwork;
var whenCGReady = function (cb) { var whenCGReady = function (cb) {
if (cgNetwork && cgNetwork !== true) { console.log(cgNetwork); return void cb(); } if (cgNetwork && cgNetwork !== true) { console.log(cgNetwork); return void cb(); }