mirror of
https://github.com/Xevion/vastly.git
synced 2025-12-06 01:16:50 -06:00
sort in internal scoring, extract latency keys in batch for top 100
This commit is contained in:
@@ -74,6 +74,10 @@ func (l *LatencyQueue) SetHandler(handler chan<- PingResult) {
|
||||
l.handlerChannel = handler
|
||||
}
|
||||
|
||||
func (l *LatencyQueue) GetSelfIP() net.IP {
|
||||
return l.ipSelf
|
||||
}
|
||||
|
||||
func (l *LatencyQueue) RefreshIP() error {
|
||||
resp, err := http.Get("https://api.ipify.org?format=text")
|
||||
if err != nil {
|
||||
@@ -145,8 +149,6 @@ func (l *LatencyQueue) Start(ctx context.Context) {
|
||||
pinger.Interval = time.Nanosecond
|
||||
pinger.Timeout = time.Millisecond * 500
|
||||
|
||||
l.logger.Debugw("Ping Request", "ip", ip)
|
||||
|
||||
// Process the request
|
||||
err = pinger.Run()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user