Revert "temporarily disable reflector and db"
This reverts commit fb2f807e6a
.
This commit is contained in:
parent
fb2f807e6a
commit
46ae5a502a
1 changed files with 17 additions and 15 deletions
|
@ -3,12 +3,14 @@ package cmd
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
|
"strconv"
|
||||||
"syscall"
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/lbryio/reflector.go/db"
|
"github.com/lbryio/reflector.go/db"
|
||||||
"github.com/lbryio/reflector.go/meta"
|
"github.com/lbryio/reflector.go/meta"
|
||||||
"github.com/lbryio/reflector.go/peer"
|
"github.com/lbryio/reflector.go/peer"
|
||||||
|
"github.com/lbryio/reflector.go/reflector"
|
||||||
"github.com/lbryio/reflector.go/store"
|
"github.com/lbryio/reflector.go/store"
|
||||||
|
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
|
@ -33,22 +35,22 @@ func reflectorCmd(cmd *cobra.Command, args []string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
s3 := store.NewS3BlobStore(globalConfig.AwsID, globalConfig.AwsSecret, globalConfig.BucketRegion, globalConfig.BucketName)
|
s3 := store.NewS3BlobStore(globalConfig.AwsID, globalConfig.AwsSecret, globalConfig.BucketRegion, globalConfig.BucketName)
|
||||||
//combo := store.NewDBBackedS3Store(s3, db)
|
combo := store.NewDBBackedS3Store(s3, db)
|
||||||
|
|
||||||
//reflectorServer := reflector.NewServer(combo)
|
reflectorServer := reflector.NewServer(combo)
|
||||||
//reflectorServer.Timeout = 3 * time.Minute
|
reflectorServer.Timeout = 3 * time.Minute
|
||||||
//if globalConfig.SlackHookURL != "" {
|
if globalConfig.SlackHookURL != "" {
|
||||||
// reflectorServer.StatLogger = log.StandardLogger()
|
reflectorServer.StatLogger = log.StandardLogger()
|
||||||
// reflectorServer.StatReportFrequency = 1 * time.Hour
|
reflectorServer.StatReportFrequency = 1 * time.Hour
|
||||||
//}
|
}
|
||||||
//reflectorServer.EnableBlocklist = true
|
reflectorServer.EnableBlocklist = true
|
||||||
//
|
|
||||||
//err = reflectorServer.Start(":" + strconv.Itoa(reflector.DefaultPort))
|
|
||||||
//if err != nil {
|
|
||||||
// log.Fatal(err)
|
|
||||||
//}
|
|
||||||
|
|
||||||
peerServer := peer.NewServer(s3)
|
err = reflectorServer.Start(":" + strconv.Itoa(reflector.DefaultPort))
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
peerServer := peer.NewServer(combo)
|
||||||
if globalConfig.SlackHookURL != "" {
|
if globalConfig.SlackHookURL != "" {
|
||||||
peerServer.StatLogger = log.StandardLogger()
|
peerServer.StatLogger = log.StandardLogger()
|
||||||
peerServer.StatReportFrequency = 1 * time.Hour
|
peerServer.StatReportFrequency = 1 * time.Hour
|
||||||
|
@ -62,5 +64,5 @@ func reflectorCmd(cmd *cobra.Command, args []string) {
|
||||||
signal.Notify(interruptChan, os.Interrupt, syscall.SIGTERM)
|
signal.Notify(interruptChan, os.Interrupt, syscall.SIGTERM)
|
||||||
<-interruptChan
|
<-interruptChan
|
||||||
peerServer.Shutdown()
|
peerServer.Shutdown()
|
||||||
//reflectorServer.Shutdown()
|
reflectorServer.Shutdown()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue