Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions sync.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -810,8 +810,8 @@ class simperium

start: =>
@stopped = false
for own name, bucket of @buckets
bucket.start()
for own name, bucketInstance of @buckets
bucketInstance.start()

stop: =>
@stopped = true
Expand All @@ -822,8 +822,8 @@ class simperium
@sock.send(data)

synced: =>
for own name, bucket of @buckets
if bucket.pending().length > 0
for own name, bucketInstance of @buckets
if bucketInstance.pending().length > 0
return false
return true

Expand All @@ -840,14 +840,14 @@ class simperium
@_sock_backoff = 3000
@connected = true
@_sock_hb_timer = setTimeout @_sock_hb_check, 20000
for own name, bucket of @buckets
if bucket.started
bucket.start()
for own name, bucketInstance of @buckets
if bucketInstance.started
bucketInstance.start()

_sock_closed: =>
@connected = false
for own name, bucket of @buckets
bucket.authorized = false
for own name, bucketInstance of @buckets
bucketInstance.authorized = false
console.log "simperium: sock js closed"
if @_sock_backoff < 4000
@_sock_backoff = @_sock_backoff + 1
Expand Down