Needs more work, but several experiments that make things more responsive under load.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3783 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2022-01-22 20:13:14 +00:00
parent 0f03701043
commit b2a552b3e0
9 changed files with 128 additions and 100 deletions

View File

@ -202,9 +202,12 @@ ssb.addRpc(['tunnel', 'isRoom'], function(request) {
function ebtReplicateSendClock(request, have) {
var me = ssb.whoami();
var message = {};
var last_sent = request.connection.sent_clock || {};
var ids = followingDeep(g_database, [me], 2).concat([request.connection.id]);
for (let id of ids) {
message[id] = get_latest_sequence_for_author(id);
if (!last_sent) {
for (let id of ids) {
message[id] = get_latest_sequence_for_author(id);
}
}
for (let id of Object.keys(have)) {
if (message[id] === undefined) {
@ -213,7 +216,6 @@ function ebtReplicateSendClock(request, have) {
}
}
var last_sent = request.connection.sent_clock || {};
var to_send = {}
for (let id of ids) {
if (last_sent[id] === undefined || message[id] > last_sent[id]) {