git ssb

4+

Dominic / scuttlebot



Commit 1fb244f868b110cf8387e9e9c04ba21062b08ff6

randomly delay scheduling connections

Dominic Tarr committed on 10/2/2016, 6:34:41 AM
Parent: b3c01b8fda9e069ecb5d1a802fafc9c563c60ee1

Files changed

plugins/gossip/schedule.jschanged
plugins/gossip/schedule.jsView
@@ -137,12 +137,19 @@
137137 })
138138 }
139139
140140
141 + var connecting = false
141142 function connections () {
143 + if(connecting) return
144 + connecting = true
145 + setTimeout(function () {
146 + connecting = false
142147 var ts = Date.now()
143148 var peers = gossip.peers()
144149
150 +// if(Math.random() > 0.1) return
151 +
145152 connect(peers, ts, 'attempt', exports.isUnattempted, {
146153 min: 0, quota: 10, factor: 0, max: 0, groupMin: 0,
147154 disable: !conf('global', true)
148155 })
@@ -167,8 +174,10 @@
167174 quota: 3, factor: 2e3, max: 10*min, groupMin: 1e3,
168175 disable: !conf('local', true)
169176 })
170177
178 + }, 100*Math.random())
179 +
171180 }
172181
173182 pull(
174183 gossip.changes(),
@@ -196,4 +205,5 @@
196205
197206
198207
199208
209 +

Built with git-ssb-web