From 630ca87f9d1d31bc94047661ac55dc1516de0131 Mon Sep 17 00:00:00 2001 From: Niko Storni Date: Thu, 2 Aug 2018 08:05:06 -0400 Subject: [PATCH] fix oversights --- ytsync/setup.go | 4 ---- ytsync/ytsync.go | 12 ++++++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ytsync/setup.go b/ytsync/setup.go index f8cc8fe..042895d 100644 --- a/ytsync/setup.go +++ b/ytsync/setup.go @@ -44,11 +44,7 @@ func (s *Sync) walletSetup() error { return nil } - //numPublished, err := s.daemon.NumClaimsInChannel(s.LbryChannelName) numPublished := uint64(len(s.syncedVideos)) //should we only count published videos? Credits are allocated even for failed ones... - if err != nil { - return err - } log.Debugf("We already published %d videos", numPublished) if float64(numOnSource)-float64(numPublished) > float64(s.Manager.VideosLimit) { diff --git a/ytsync/ytsync.go b/ytsync/ytsync.go index b1a3ce2..969a658 100644 --- a/ytsync/ytsync.go +++ b/ytsync/ytsync.go @@ -499,16 +499,21 @@ func (s *Sync) processVideo(v video) (err error) { sv, ok := s.syncedVideos[v.ID()] alreadyPublished := ok && sv.Published - if ok && !sv.Published && strings.Contains(sv.FailureReason, "Error extracting sts from embedded url response") { - log.Println(v.ID() + " can't be published") + neverRetryFailures := []string{ + "Error extracting sts from embedded url response", + "the video is too big to sync, skipping for now", + } + if ok && !sv.Published && util.SubstringInSlice(sv.FailureReason, neverRetryFailures) { + log.Println(v.ID() + " can't ever be published") return nil } + //TODO: remove this after a few runs... alreadyPublishedOld, err := s.db.IsPublished(v.ID()) if err != nil { return err } - //TODO: remove this after a few runs + //TODO: remove this after a few runs... if alreadyPublishedOld && !alreadyPublished { //seems like something in the migration of blobs didn't go perfectly right so warn about it! SendInfoToSlack("A video that was previously published is on the local database but isn't on the remote db! fix it @Nikooo777! \nchannelID: %s, videoID: %s", @@ -533,7 +538,6 @@ func (s *Sync) processVideo(v video) (err error) { if err != nil { SendErrorToSlack("Failed to mark video on the database: %s", err.Error()) } - //err = s.db.SetPublished(v.ID()) if err != nil { return err }