git ssb

4+

Dominic / scuttlebot



Commit 7631c51207229346467d70e5b00b51c6f860c61b

don't attempt to connect to peers while migration is running

Matt McKegg committed on 6/17/2017, 2:39:37 PM
Parent: a8eda5e5db9ec86d6df1064d0c0c8e1c23a5d62f

Files changed

index.jschanged
plugins/gossip/schedule.jschanged
index.jsView
@@ -77,14 +77,18 @@
7777
7878 //remove this, but we'll need something to make a progress bar
7979 //otherwise people will get confused about what is happening.
8080
81-
8281
82+
8383 return {
8484 id : feed.id,
8585 keys : opts.keys,
8686
87+ ready : function () {
88+ return ssb.ready.value
89+ },
90+
8791 progress : function () {
8892 return ssb.progress
8993 },
9094
@@ -157,7 +161,4 @@
157161 //when creating a Sbot instance.
158162 appKey: require('./lib/ssb-cap')
159163 })
160164 .use(SSB)
161-
162-
163-
plugins/gossip/schedule.jsView
@@ -143,8 +143,12 @@
143143 if(connecting) return
144144 connecting = true
145145 setTimeout(function () {
146146 connecting = false
147+
148+ // don't attempt to connect while migration is running
149+ if (!server.ready()) return
150+
147151 var ts = Date.now()
148152 var peers = gossip.peers()
149153
150154 var connected = peers.filter(and(isConnect, not(isLocal), not(isFriend))).length
@@ -238,5 +242,4 @@
238242 exports.isLocal = isLocal
239243 exports.isFriend = isFriend
240244 exports.isConnectedOrConnecting = isConnect
241245 exports.select = select
242-

Built with git-ssb-web