add regtest support

improve error handling
This commit is contained in:
Niko Storni 2018-05-17 13:37:12 -04:00
parent e4bc1897f3
commit 47a9b6e0d1

View file

@ -85,8 +85,10 @@ func (s *Sync) FullCycle() error {
}
s.YoutubeChannelID = channelID
}
defaultWalletDir := os.Getenv("HOME") + "/.lbryum/wallets/default_wallet"
if os.Getenv("REGTEST") == "true" {
defaultWalletDir = os.Getenv("HOME") + "/.lbryum_regtest/wallets/default_wallet"
}
walletBackupDir := os.Getenv("HOME") + "/wallets/" + strings.Replace(s.LbryChannelName, "@", "", 1)
if _, err := os.Stat(defaultWalletDir); !os.IsNotExist(err) {
@ -185,7 +187,7 @@ func (s *Sync) doSync() error {
err = s.walletSetup()
if err != nil {
return err
return errors.Err("Initial wallet setup failed! Manual Intervention is required. Reason: %v", err)
}
if s.StopOnError {
@ -276,7 +278,7 @@ func (s *Sync) startWorker(workerNum int) {
log.Println("Retrying")
continue
}
util.SendToSlackError("Video failed after %d retries, skipping. Stack: %s", s.MaxTries, logMsg)
util.SendToSlackError("Video failed after %d retries, skipping. Stack: %s", tryCount, logMsg)
}
}
break