kopia lustrzana https://github.com/bugout-dev/moonstream
Reduced logging
rodzic
3d11433056
commit
0e5fb1307e
|
@ -104,7 +104,7 @@ func (bpool *BlockchainPool) GetNextNode(blockchain string) *Node {
|
||||||
// If we have an alive one, use it and store if its not the original one
|
// If we have an alive one, use it and store if its not the original one
|
||||||
if np.Nodes[idx].IsAlive() {
|
if np.Nodes[idx].IsAlive() {
|
||||||
if i != next {
|
if i != next {
|
||||||
log.Printf("Mark the current one %d", uint64(idx))
|
// Mark the current one
|
||||||
atomic.StoreUint64(&np.Current, uint64(idx))
|
atomic.StoreUint64(&np.Current, uint64(idx))
|
||||||
}
|
}
|
||||||
// Pass nodes with low blocks
|
// Pass nodes with low blocks
|
||||||
|
|
|
@ -6,7 +6,6 @@ package cmd
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
@ -35,7 +34,6 @@ func lbHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
clientId := w.Header().Get(configs.MOONSTREAM_CLIENT_ID_HEADER)
|
clientId := w.Header().Get(configs.MOONSTREAM_CLIENT_ID_HEADER)
|
||||||
if clientId == "" {
|
if clientId == "" {
|
||||||
log.Printf("Empty client id provided")
|
|
||||||
// TODO(kompotkot): After all internal crawlers and services start
|
// TODO(kompotkot): After all internal crawlers and services start
|
||||||
// providing client id header, then replace to http.Error
|
// providing client id header, then replace to http.Error
|
||||||
clientId = "none"
|
clientId = "none"
|
||||||
|
@ -48,7 +46,7 @@ func lbHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
http.Error(w, fmt.Sprintf("Unacceptable blockchain provided %s", blockchain), http.StatusBadRequest)
|
http.Error(w, fmt.Sprintf("Unacceptable blockchain provided %s", blockchain), http.StatusBadRequest)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
cpool.GetClientNode(clientId)
|
node = cpool.GetClientNode(clientId)
|
||||||
if node == nil {
|
if node == nil {
|
||||||
node = blockchainPool.GetNextNode(blockchain)
|
node = blockchainPool.GetNextNode(blockchain)
|
||||||
if node == nil {
|
if node == nil {
|
||||||
|
|
Ładowanie…
Reference in New Issue