fix oversights

This commit is contained in:
Niko Storni 2018-08-02 08:05:06 -04:00
parent b3f7f93f5f
commit 630ca87f9d
No known key found for this signature in database
GPG key ID: F37FE63398800368
2 changed files with 8 additions and 8 deletions

View file

@ -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) {

View file

@ -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
}