5
0
mirror of https://github.com/cwinfo/yggdrasil-map synced 2024-11-22 01:10:28 +00:00

try to fix some long delays with the crawler

This commit is contained in:
Arceliar 2022-04-29 05:14:12 -05:00
parent 19cdf8de34
commit 6a307ab37e
2 changed files with 9 additions and 2 deletions

View File

@ -48,12 +48,17 @@ func doRequest(request map[string]interface{}) map[string]interface{} {
panic(err)
}
bs := make([]byte, 65535)
deadline := time.Now().Add(6 * time.Second)
sock.SetReadDeadline(deadline)
n, err := sock.Read(bs)
sock.Close()
if err != nil {
continue
panic(bs)
}
bs = bs[:n]
if err = json.Unmarshal(bs, &res); err != nil {
return nil
panic(err)
}
// TODO parse res, check if there's an error

View File

@ -36,6 +36,8 @@ for kdx in xrange(len(kinds)):
axs[kdx].set_title("ratio (dht/peers)")
axs[kdx].hist(bins, bins=nbins)
plt.savefig("fig.svg")
plt.yscale('log')
plt.savefig("fig-logy.svg")
print results