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 10 deletions
Showing only changes of commit 9cfda0df64 - Show all commits

View file

@ -256,7 +256,7 @@ func (s SyncManager) Start() error {
time.Sleep(5 * time.Minute) time.Sleep(5 * time.Minute)
} }
for i, sync := range syncs { for i, sync := range syncs {
SendInfoToSlack("Syncing %s to LBRY! (iteration %d/%d - total session iterations: %d)", sync.LbryChannelName, i, len(syncs), syncCount) SendInfoToSlack("Syncing %s to LBRY! (iteration %d/%d - total session iterations: %d)", sync.LbryChannelName, i+1, len(syncs), syncCount)
err := sync.FullCycle() err := sync.FullCycle()
if err != nil { if err != nil {
fatalErrors := []string{ fatalErrors := []string{

View file

@ -55,7 +55,7 @@ func (s *Sync) walletSetup() error {
//TODO: get rid of this as soon as we compute this condition using the database in a more reliable way //TODO: get rid of this as soon as we compute this condition using the database in a more reliable way
if numPublished >= numOnSource { if numPublished >= numOnSource {
return errors.Err("channel is already up to date") return nil
} }
minBalance := (float64(numOnSource)-float64(numPublished))*(publishAmount+0.1) + channelClaimAmount minBalance := (float64(numOnSource)-float64(numPublished))*(publishAmount+0.1) + channelClaimAmount
if numPublished > numOnSource { if numPublished > numOnSource {
@ -107,14 +107,6 @@ func (s *Sync) ensureEnoughUTXOs() error {
return errors.Err("no response") return errors.Err("no response")
} }
if !allUTXOsConfirmed(utxolist) {
log.Println("Waiting for previous txns to confirm") // happens if you restarted the daemon soon after a previous publish run
err := s.waitUntilUTXOsConfirmed()
if err != nil {
return err
}
}
target := 40 target := 40
count := 0 count := 0
@ -154,6 +146,12 @@ func (s *Sync) ensureEnoughUTXOs() error {
if err != nil { if err != nil {
return err return err
} }
} else if !allUTXOsConfirmed(utxolist) {
log.Println("Waiting for previous txns to confirm")
err := s.waitUntilUTXOsConfirmed()
if err != nil {
return err
}
} }
return nil return nil