add fallback for socialblade API failures
This commit is contained in:
parent
7c02c5b92d
commit
7e83b17b69
1 changed files with 3 additions and 2 deletions
|
@ -75,7 +75,8 @@ func (s *Sync) walletSetup() error {
|
||||||
|
|
||||||
videosOnYoutube, err := ytapi.CountVideosInChannel(s.DbChannelData.ChannelId)
|
videosOnYoutube, err := ytapi.CountVideosInChannel(s.DbChannelData.ChannelId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
logUtils.SendErrorToSlack(errors.FullTrace(errors.Prefix("failed to get video count through socialblade. Falling back to API count", err)))
|
||||||
|
videosOnYoutube = int(s.DbChannelData.TotalVideos)
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Debugf("Source channel has %d videos", videosOnYoutube)
|
log.Debugf("Source channel has %d videos", videosOnYoutube)
|
||||||
|
@ -416,7 +417,7 @@ func (s *Sync) ensureChannelOwnership() error {
|
||||||
//}
|
//}
|
||||||
var locations []jsonrpc.Location = nil
|
var locations []jsonrpc.Location = nil
|
||||||
if channelInfo.Topbar.DesktopTopbarRenderer.CountryCode != "" {
|
if channelInfo.Topbar.DesktopTopbarRenderer.CountryCode != "" {
|
||||||
locations = []jsonrpc.Location{{Country: util.PtrToString(channelInfo.Topbar.DesktopTopbarRenderer.CountryCode)}}
|
locations = []jsonrpc.Location{{Country: &channelInfo.Topbar.DesktopTopbarRenderer.CountryCode}}
|
||||||
}
|
}
|
||||||
var c *jsonrpc.TransactionSummary
|
var c *jsonrpc.TransactionSummary
|
||||||
claimCreateOptions := jsonrpc.ClaimCreateOptions{
|
claimCreateOptions := jsonrpc.ClaimCreateOptions{
|
||||||
|
|
Loading…
Reference in a new issue