git ssb

4+

Dominic / scuttlebot



Commit 04fc25d9007bedb4d8b07cae8bc7d20c5ecd695c

remove race-condition in test/realtime.js

Dominic Tarr committed on 10/1/2017, 8:46:56 AM
Parent: b626e54fb122fbc24c01380a0defcf468615379f

Files changed

test/realtime.jschanged
test/realtime.jsView
@@ -44,11 +44,10 @@
4444 ary.push(data);
4545 })
4646 )
4747 var l = 12
48- var int = setInterval(function () {
48 + setTimeout(function next () {
4949 if(!--l) {
50- clearInterval(int)
5150 var _ary = []
5251 pull(
5352 bob.createHistoryStream({id: alice.id, sequence: 0, keys: false}),
5453 pull.collect(function (err, _ary) {
@@ -62,11 +61,11 @@
6261 alice.publish({type: 'test', value: new Date()},
6362 function (err, msg){
6463 if(err) throw err
6564 console.log('added', msg.key, msg.value.sequence)
65 + setTimeout(next, 200)
6666 })
6767 }, 200)
6868
6969 })
7070 })
7171
72-

Built with git-ssb-web