don't publish when running out of space

This commit is contained in:
Niko Storni 2018-08-17 14:05:39 -04:00
parent e08e1bd3a4
commit 41551c8e01

View file

@ -316,6 +316,7 @@ func (s *Sync) startWorker(workerNum int) {
"no space left on device", "no space left on device",
"NotEnoughFunds", "NotEnoughFunds",
"Cannot publish using channel", "Cannot publish using channel",
"more than 90% of the space has been used.",
} }
if util.SubstringInSlice(err.Error(), fatalErrors) || s.StopOnError { if util.SubstringInSlice(err.Error(), fatalErrors) || s.StopOnError {
s.grp.Stop() s.grp.Stop()
@ -546,6 +547,10 @@ func (s *Sync) processVideo(v video) (err error) {
log.Println(v.ID() + " is old: skipping") log.Println(v.ID() + " is old: skipping")
return nil return nil
} }
err = s.Manager.checkUsedSpace()
if err != nil {
return err
}
summary, err := v.Sync(s.daemon, s.claimAddress, publishAmount, s.lbryChannelID, s.Manager.MaxVideoSize) summary, err := v.Sync(s.daemon, s.claimAddress, publishAmount, s.lbryChannelID, s.Manager.MaxVideoSize)
if err != nil { if err != nil {
return err return err