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 (
|
||||
"os"
|
||||
"os/signal"
|
||||
"strconv"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/lbryio/reflector.go/db"
|
||||
"github.com/lbryio/reflector.go/meta"
|
||||
"github.com/lbryio/reflector.go/peer"
|
||||
"github.com/lbryio/reflector.go/reflector"
|
||||
"github.com/lbryio/reflector.go/store"
|
||||
|
||||
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)
|
||||
//combo := store.NewDBBackedS3Store(s3, db)
|
||||
combo := store.NewDBBackedS3Store(s3, db)
|
||||
|
||||
//reflectorServer := reflector.NewServer(combo)
|
||||
//reflectorServer.Timeout = 3 * time.Minute
|
||||
//if globalConfig.SlackHookURL != "" {
|
||||
// reflectorServer.StatLogger = log.StandardLogger()
|
||||
// reflectorServer.StatReportFrequency = 1 * time.Hour
|
||||
//}
|
||||
//reflectorServer.EnableBlocklist = true
|
||||
//
|
||||
//err = reflectorServer.Start(":" + strconv.Itoa(reflector.DefaultPort))
|
||||
//if err != nil {
|
||||
// log.Fatal(err)
|
||||
//}
|
||||
reflectorServer := reflector.NewServer(combo)
|
||||
reflectorServer.Timeout = 3 * time.Minute
|
||||
if globalConfig.SlackHookURL != "" {
|
||||
reflectorServer.StatLogger = log.StandardLogger()
|
||||
reflectorServer.StatReportFrequency = 1 * time.Hour
|
||||
}
|
||||
reflectorServer.EnableBlocklist = true
|
||||
|
||||
peerServer := peer.NewServer(s3)
|
||||
err = reflectorServer.Start(":" + strconv.Itoa(reflector.DefaultPort))
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
peerServer := peer.NewServer(combo)
|
||||
if globalConfig.SlackHookURL != "" {
|
||||
peerServer.StatLogger = log.StandardLogger()
|
||||
peerServer.StatReportFrequency = 1 * time.Hour
|
||||
|
@ -62,5 +64,5 @@ func reflectorCmd(cmd *cobra.Command, args []string) {
|
|||
signal.Notify(interruptChan, os.Interrupt, syscall.SIGTERM)
|
||||
<-interruptChan
|
||||
peerServer.Shutdown()
|
||||
//reflectorServer.Shutdown()
|
||||
reflectorServer.Shutdown()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue