remove redisDB dependency #25
2 changed files with 8 additions and 8 deletions
|
@ -44,11 +44,7 @@ func (s *Sync) walletSetup() error {
|
|||
return nil
|
||||
}
|
||||
![]() Grins previous review outlined a mess with casts here and there to make simple math. Grins previous review outlined a mess with casts here and there to make simple math.
I changed everything to int as it's reasonable for the values they represent.
|
||||
|
||||
//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...
|
||||
![]() what is this?! not part of the PR but this is not good to have in the code base. what is this?! not part of the PR but this is not good to have in the code base.
![]() I can explain the berkeley stuff to you via DM, it's all good as it will be eventually removed from here. Not worth changing now I can explain the berkeley stuff to you via DM, it's all good as it will be eventually removed from here. Not worth changing now
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
log.Debugf("We already published %d videos", numPublished)
|
||||
|
||||
if float64(numOnSource)-float64(numPublished) > float64(s.Manager.VideosLimit) {
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue
why change this to an int? It better to be more specific than more general.