Compare commits

...
2 Commits
Author SHA1 Message Date
Niko Storni 47e467057d change timeouts to avoid long wait times 2020-05-20 04:28:29 +02:00
Niko Storni 1ae32d638b fix prom allowed chars 2020-05-19 23:24:16 +02:00
3 changed files with 11 additions and 5 deletions

No files matched your search

+2 -2
View File
@@ -95,8 +95,8 @@ func abandonSupports(s *Sync) (float64, error) {
}()
consumerWG := &stop.Group{}
//TODO: remove this once the SDK team fixes their RPC bugs....
s.daemon.SetRPCTimeout(30 * time.Second)
defer s.daemon.SetRPCTimeout(20 * time.Minute)
s.daemon.SetRPCTimeout(60 * time.Second)
defer s.daemon.SetRPCTimeout(5 * time.Minute)
for i := 0; i < s.ConcurrentVideos; i++ {
consumerWG.Add(1)
go func() {
+1 -1
View File
@@ -307,7 +307,7 @@ func (s *Sync) FullCycle() (e error) {
log.Infoln("Waiting for daemon to finish starting...")
s.daemon = jsonrpc.NewClient(os.Getenv("LBRYNET_ADDRESS"))
s.daemon.SetRPCTimeout(20 * time.Minute)
s.daemon.SetRPCTimeout(5 * time.Minute)
err = s.waitForDaemonStart()
if err != nil {
+8 -2
View File
@@ -2,9 +2,11 @@ package metrics
import (
"os"
"regexp"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
log "github.com/sirupsen/logrus"
)
var (
@@ -19,7 +21,11 @@ var (
func getHostname() string {
hostname, err := os.Hostname()
if err != nil {
hostname = "ytsync-unknown"
hostname = "ytsync_unknown"
}
return hostname
reg, err := regexp.Compile("[^a-zA-Z0-9_]+")
if err != nil {
log.Fatal(err)
}
return reg.ReplaceAllString(hostname, "_")
}