Do all the non-rss refreshes last.
This commit is contained in:
parent
ca353e9977
commit
2aa23ac2aa
1 changed files with 8 additions and 2 deletions
|
@ -114,6 +114,8 @@ class YCDLDBChannelMixin:
|
|||
'''
|
||||
excs = []
|
||||
|
||||
need_traditional = []
|
||||
|
||||
def traditional(channel):
|
||||
try:
|
||||
channel.refresh(rss_assisted=False)
|
||||
|
@ -131,11 +133,11 @@ class YCDLDBChannelMixin:
|
|||
yield from new_ids
|
||||
except (exceptions.NoVideos, exceptions.RSSAssistFailed) as exc:
|
||||
log.debug(
|
||||
'RSS assist for %s failed "%s", using traditional refresh.',
|
||||
'RSS assist for %s failed "%s", adding to traditional queue.',
|
||||
channel.id,
|
||||
exc.error_message
|
||||
)
|
||||
traditional(channel)
|
||||
need_traditional.append(channel)
|
||||
|
||||
video_ids = lazychain.LazyChain()
|
||||
|
||||
|
@ -153,6 +155,10 @@ class YCDLDBChannelMixin:
|
|||
for video in self.youtube.get_videos(video_ids):
|
||||
self.ingest_video(video)
|
||||
|
||||
for channel in need_traditional:
|
||||
log.debug('Using traditional refresh for %s.', channel.id)
|
||||
traditional(channel)
|
||||
|
||||
return excs
|
||||
|
||||
@worms.atomic
|
||||
|
|
Loading…
Reference in a new issue