improve logging

This commit is contained in:
Niko Storni 2020-11-04 18:13:30 +01:00
parent f7e4366a67
commit 881d86799b
3 changed files with 7 additions and 5 deletions

View file

@ -46,6 +46,7 @@ func reflectBlobs() error {
if util.IsBlobReflectionOff() {
return nil
}
logrus.Infoln("reflecting blobs...")
//make sure lbrynet is off
running, err := util.IsLbrynetRunning()
if err != nil {
@ -72,9 +73,7 @@ func reflectBlobs() error {
return errors.Err(err)
}
}
st := store.NewDBBackedStore(
store.NewS3BlobStore(config.AwsID, config.AwsSecret, config.BucketRegion, config.BucketName),
dbHandle)
st := store.NewDBBackedStore(store.NewS3BlobStore(config.AwsID, config.AwsSecret, config.BucketRegion, config.BucketName), dbHandle)
uploadWorkers := 10
uploader := reflector.NewUploader(dbHandle, st, uploadWorkers, false, false)

View file

@ -9,6 +9,7 @@ import (
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/aws/aws-sdk-go/service/s3/s3manager"
log "github.com/sirupsen/logrus"
"github.com/lbryio/lbry.go/v2/extras/errors"
@ -138,7 +139,7 @@ func (s *Sync) downloadBlockchainDB() error {
if err != nil {
return errors.Prefix("error replacing temp blockchain.db for default blockchain.db: ", err)
}
log.Printf("blockchain.db downloaded to %s", defaultBDBDir)
return nil
}
@ -214,6 +215,7 @@ func (s *Sync) uploadWallet() error {
if err != nil {
return err
}
log.Println("wallet uploaded to S3")
return os.Remove(defaultWalletDir)
}
@ -247,6 +249,6 @@ func (s *Sync) uploadBlockchainDB() error {
if err != nil {
return err
}
log.Println("blockchain.db uploaded to S3")
return os.Remove(defaultBDBDir)
}

View file

@ -1089,6 +1089,7 @@ func waitForDaemonProcess(timeout time.Duration) error {
return errors.Err(err)
}
if !running {
log.Println("daemon stopped")
return nil
}
}