(done) replace redigo with go-redis

* replace redis keys with RawString encoded values (delete SerializedPeer)
* merge peers got from pre-hools with store data
This commit is contained in:
Lawrence, Rendall
2022-04-14 00:55:58 +03:00
parent 1fcddf5102
commit 781fa9440f
20 changed files with 490 additions and 455 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ func init() {
var promResponseDurationMilliseconds = prometheus.NewHistogramVec(
prometheus.HistogramOpts{
Name: "chihaya_http_response_duration_milliseconds",
Name: "mochi_http_response_duration_milliseconds",
Help: "The duration of time it takes to receive and write a response to an API request",
Buckets: prometheus.ExponentialBuckets(9.375, 2, 10),
},
+2 -4
View File
@@ -103,8 +103,7 @@ func compact4(peer bittorrent.Peer) (buf []byte) {
} else {
buf = ip
}
buf = append(buf, byte(peer.Port>>8))
buf = append(buf, byte(peer.Port&0xff))
buf = append(buf, byte(peer.Port>>8), byte(peer.Port))
return
}
@@ -114,8 +113,7 @@ func compact6(peer bittorrent.Peer) (buf []byte) {
} else {
buf = ip
}
buf = append(buf, byte(peer.Port>>8))
buf = append(buf, byte(peer.Port&0xff))
buf = append(buf, byte(peer.Port>>8), byte(peer.Port))
return
}