decreased sync timeout

This commit is contained in:
Kevin Jahns
2014-09-29 12:26:04 +02:00
parent 6623bd6134
commit 607d442abc
36 changed files with 45 additions and 46 deletions

View File

@@ -44,10 +44,10 @@ createPeerJsConnector = ()->
@addConnection conn
sync_every_collaborator = ()=>
for conn_id, conn of @connections
conn.send
sync_state_vector: @HB.getOperationCounter()
setInterval sync_every_collaborator, 8000
for conn_id, conn of @connections
conn.send
sync_state_vector: @HB.getOperationCounter()
setInterval sync_every_collaborator, 4000
send_ = (o)=>
if o.uid.creator is @HB.getUserId() and (typeof o.uid.op_number isnt "string")
@@ -122,7 +122,7 @@ createPeerJsConnector = ()->
initialized: false
initialized_him = true
else
throw new Error "Can't parse this operation"
throw new Error "Can't parse this operation #{data}"
sendStateVector = ()=>
conn.send

View File

@@ -20,7 +20,7 @@ class HistoryBuffer
@garbage = [] # Will be cleaned on next call of garbageCollector
@trash = [] # Is deleted. Wait until it is not used anymore.
@performGarbageCollection = true
@garbageCollectTimeout = 8000
@garbageCollectTimeout = 1000
@reserved_identifier_counter = 0
setTimeout @emptyGarbage, @garbageCollectTimeout
@@ -96,6 +96,7 @@ class HistoryBuffer
not state_vector[user]? or state_vector[user] <= o_number
for u_name,user of @buffer
# TODO next, if @state_vector[user] <= state_vector[user]
for o_number,o of user
if o.doSync and unknown(u_name, o_number)
# its necessary to send it, and not known in state_vector