From 41551c8e017ffea6015425e87fcdcbe55622fe4d Mon Sep 17 00:00:00 2001 From: Niko Storni Date: Fri, 17 Aug 2018 14:05:39 -0400 Subject: [PATCH] don't publish when running out of space --- ytsync.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ytsync.go b/ytsync.go index 7e96371..c44d9c6 100644 --- a/ytsync.go +++ b/ytsync.go @@ -316,6 +316,7 @@ func (s *Sync) startWorker(workerNum int) { "no space left on device", "NotEnoughFunds", "Cannot publish using channel", + "more than 90% of the space has been used.", } if util.SubstringInSlice(err.Error(), fatalErrors) || s.StopOnError { s.grp.Stop() @@ -546,6 +547,10 @@ func (s *Sync) processVideo(v video) (err error) { log.Println(v.ID() + " is old: skipping") 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) if err != nil { return err