More debug output and servers refresh fix.

Fixed servers lists refresh. Despite on what list we're updating
(all servers or only favorites) server item should be updated in
both.
This commit is contained in:
2016-10-07 02:50:52 +05:00
parent baf733f171
commit 51b23fa68f
4 changed files with 35 additions and 23 deletions

View File

@@ -14,7 +14,7 @@ import (
"errors"
"fmt"
"net"
"runtime"
//"runtime"
"strconv"
"strings"
"sync"
@@ -34,8 +34,9 @@ type Pooler struct {
func (p *Pooler) Initialize() {
fmt.Println("Initializing requester goroutine pooler...")
// ToDo: figure out how to make this work nice.
p.maxrequests = runtime.NumCPU() * 2000
p.maxrequests = 500
p.pp = "\377\377\377\377"
fmt.Println("Pooler initialized")
}
// Servers pinging pooler. Should be started as goroutine to prevent
@@ -119,16 +120,12 @@ func (p *Pooler) UpdateServers(servers_type string) {
}(server.Server)
}
wait.Wait()
Eventer.LaunchEvent("flushServers")
p.PingServers(servers_type)
Eventer.LaunchEvent("flushServers")
if servers_type == "all" {
Eventer.LaunchEvent("loadAllServers")
Eventer.LaunchEvent("serversUpdateCompleted")
} else if servers_type == "favorites" {
Eventer.LaunchEvent("loadFavoriteServers")
Eventer.LaunchEvent("serversUpdateCompleted")
}
Eventer.LaunchEvent("loadAllServers")
Eventer.LaunchEvent("loadFavoriteServers")
Eventer.LaunchEvent("serversUpdateCompleted")
}
// Updates information about specific server.