fix oversights
This commit is contained in:
parent
9845ac1181
commit
e15476b4f8
2 changed files with 8 additions and 8 deletions
4
setup.go
4
setup.go
|
@ -44,11 +44,7 @@ func (s *Sync) walletSetup() error {
|
||||||
return nil
|
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...
|
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)
|
log.Debugf("We already published %d videos", numPublished)
|
||||||
|
|
||||||
if float64(numOnSource)-float64(numPublished) > float64(s.Manager.VideosLimit) {
|
if float64(numOnSource)-float64(numPublished) > float64(s.Manager.VideosLimit) {
|
||||||
|
|
12
ytsync.go
12
ytsync.go
|
@ -499,16 +499,21 @@ func (s *Sync) processVideo(v video) (err error) {
|
||||||
sv, ok := s.syncedVideos[v.ID()]
|
sv, ok := s.syncedVideos[v.ID()]
|
||||||
alreadyPublished := ok && sv.Published
|
alreadyPublished := ok && sv.Published
|
||||||
|
|
||||||
if ok && !sv.Published && strings.Contains(sv.FailureReason, "Error extracting sts from embedded url response") {
|
neverRetryFailures := []string{
|
||||||
log.Println(v.ID() + " can't be published")
|
"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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO: remove this after a few runs...
|
||||||
alreadyPublishedOld, err := s.db.IsPublished(v.ID())
|
alreadyPublishedOld, err := s.db.IsPublished(v.ID())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
//TODO: remove this after a few runs
|
//TODO: remove this after a few runs...
|
||||||
if alreadyPublishedOld && !alreadyPublished {
|
if alreadyPublishedOld && !alreadyPublished {
|
||||||
//seems like something in the migration of blobs didn't go perfectly right so warn about it!
|
//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",
|
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 {
|
if err != nil {
|
||||||
SendErrorToSlack("Failed to mark video on the database: %s", err.Error())
|
SendErrorToSlack("Failed to mark video on the database: %s", err.Error())
|
||||||
}
|
}
|
||||||
//err = s.db.SetPublished(v.ID())
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue