remove redisDB dependency #25

Merged
nikooo777 merged 12 commits from use_video_statuses into master 2018-08-20 13:56:26 +02:00
2 changed files with 8 additions and 8 deletions
Showing only changes of commit 630ca87f9d - Show all commits

View file

@ -44,11 +44,7 @@ func (s *Sync) walletSetup() error {
return nil
}
tiger5226 commented 2018-08-17 01:06:12 +02:00 (Migrated from github.com)
Review

why change this to an int? It better to be more specific than more general.

why change this to an int? It better to be more specific than more general.
nikooo777 commented 2018-08-20 13:46:43 +02:00 (Migrated from github.com)
Review

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.

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...
tiger5226 commented 2018-08-17 01:07:02 +02:00 (Migrated from github.com)
Review

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.
nikooo777 commented 2018-08-20 13:52:54 +02:00 (Migrated from github.com)
Review

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

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
}