diff --git a/go.mod b/go.mod index 4df21c2..19b3b1c 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect github.com/kr/pretty v0.1.0 // indirect github.com/lbryio/errors.go v0.0.0-20180223142025-ad03d3cc6a5c - github.com/lbryio/lbry.go v1.0.13 + github.com/lbryio/lbry.go v1.0.14 github.com/lusis/slack-test v0.0.0-20190408224659-6cf59653add2 // indirect github.com/mitchellh/go-ps v0.0.0-20170309133038-4fdf99ab2936 github.com/mitchellh/mapstructure v1.1.2 // indirect diff --git a/go.sum b/go.sum index e7c853d..ce642ca 100644 --- a/go.sum +++ b/go.sum @@ -129,8 +129,8 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/lbryio/errors.go v0.0.0-20180223142025-ad03d3cc6a5c h1:BhdcWGsuKif/XoSZnqVGNqJ1iEmH0czWR5upj+AuR8M= github.com/lbryio/errors.go v0.0.0-20180223142025-ad03d3cc6a5c/go.mod h1:muH7wpUqE8hRA3OrYYosw9+Sl681BF9cwcjzE+OCNK8= -github.com/lbryio/lbry.go v1.0.13 h1:IwQwI/quBds3DW/nnnbM7llCDrw9YShBSpSD39eR3Z8= -github.com/lbryio/lbry.go v1.0.13/go.mod h1:JtyI30bU51rm0LZ/po3mQuzf++14OWb6kR/6mMRAmKU= +github.com/lbryio/lbry.go v1.0.14 h1:lpaO96YyP3d2RJzgl1WFkcyS15/ROd04OV3S1E5Av8E= +github.com/lbryio/lbry.go v1.0.14/go.mod h1:JtyI30bU51rm0LZ/po3mQuzf++14OWb6kR/6mMRAmKU= github.com/lbryio/lbryschema.go v0.0.0-20190428231007-c54836bca002 h1:urfYK5ElpUrAv90auPLldoVC60LwiGAcY0OE6HJB9KI= github.com/lbryio/lbryschema.go v0.0.0-20190428231007-c54836bca002/go.mod h1:dAzPCBj3CKKWBGYBZxK6tKBP5SCgY2tqd9SnQd/OyKo= github.com/lbryio/ozzo-validation v0.0.0-20170323141101-d1008ad1fd04 h1:Nze+C2HbeKvhjI/kVn+9Poj/UuEW5sOQxcsxqO7L3GI= diff --git a/manager/manager.go b/manager/manager.go index 8ad0c36..949d642 100644 --- a/manager/manager.go +++ b/manager/manager.go @@ -142,6 +142,7 @@ func (s *SyncManager) Start() error { shouldInterruptLoop = true } else { var queuesToSync []string + //TODO: implement scrambling to avoid starvation of queues if s.syncStatus != "" { queuesToSync = append(queuesToSync, s.syncStatus) } else if s.syncUpdate { @@ -154,7 +155,9 @@ func (s *SyncManager) Start() error { if err != nil { return err } - for _, c := range channels { + log.Infof("There are %d channels in the \"%s\" queue", len(channels), q) + if len(channels) > 0 { + c := channels[0] syncs = append(syncs, Sync{ APIConfig: s.apiConfig, YoutubeChannelID: c.ChannelId, @@ -174,6 +177,7 @@ func (s *SyncManager) Start() error { namer: namer.NewNamer(), Fee: c.Fee, }) + break } } } @@ -181,9 +185,9 @@ func (s *SyncManager) Start() error { log.Infoln("No channels to sync. Pausing 5 minutes!") time.Sleep(5 * time.Minute) } - for i, sync := range syncs { + for _, sync := range syncs { shouldNotCount := false - SendInfoToSlack("Syncing %s (%s) to LBRY! (iteration %d/%d - total processed channels: %d)", sync.LbryChannelName, sync.YoutubeChannelID, i+1, len(syncs), syncCount+1) + SendInfoToSlack("Syncing %s (%s) to LBRY! total processed channels since startup: %d", sync.LbryChannelName, sync.YoutubeChannelID, syncCount+1) err := sync.FullCycle() if err != nil { fatalErrors := []string{ @@ -203,7 +207,7 @@ func (s *SyncManager) Start() error { SendInfoToSlack("A non fatal error was reported by the sync process. %s\nContinuing...", err.Error()) } } - SendInfoToSlack("Syncing %s (%s) reached an end. (iteration %d/%d - total processed channels: %d)", sync.LbryChannelName, sync.YoutubeChannelID, i+1, len(syncs), syncCount+1) + SendInfoToSlack("Syncing %s (%s) reached an end. total processed channels since startup: %d", sync.LbryChannelName, sync.YoutubeChannelID, syncCount+1) if !shouldNotCount { syncCount++ } diff --git a/manager/setup.go b/manager/setup.go index c275182..aa5326d 100644 --- a/manager/setup.go +++ b/manager/setup.go @@ -33,7 +33,8 @@ func (s *Sync) enableAddressReuse() error { } for _, a := range accounts { _, err = s.daemon.AccountSet(a.ID, jsonrpc.AccountSettings{ - ChangeMaxUses: 1000, + ChangeMaxUses: util.PtrToInt(1000), + ReceivingMaxUses: util.PtrToInt(100), }) if err != nil { return errors.Err(err)