1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-26 15:42:21 +08:00

fix(race condition)

https://github.com/jbenet/go-ipfs/issues/270
This commit is contained in:
Brian Tiger Chow
2014-11-05 08:38:26 -08:00
parent 3bc2281c51
commit de61d663b5

View File

@ -239,17 +239,17 @@ func TestFastRepublish(t *testing.T) {
}
// constantly keep writing to the file
go func() {
go func(timeout time.Duration) {
for {
select {
case <-closed:
return
case <-time.After(shortRepublishTimeout * 8 / 10):
case <-time.After(timeout * 8 / 10):
writeFileData(t, dataB, fname)
}
}
}()
}(shortRepublishTimeout)
hasPublished := func() bool {
res, err := node.Namesys.Resolve(pubkeyHash)