diff --git a/cmd/reflector.go b/cmd/reflector.go index c91acae..8659056 100644 --- a/cmd/reflector.go +++ b/cmd/reflector.go @@ -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() }