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 = []
|
excs = []
|
||||||
|
|
||||||
|
need_traditional = []
|
||||||
|
|
||||||
def traditional(channel):
|
def traditional(channel):
|
||||||
try:
|
try:
|
||||||
channel.refresh(rss_assisted=False)
|
channel.refresh(rss_assisted=False)
|
||||||
|
@ -131,11 +133,11 @@ class YCDLDBChannelMixin:
|
||||||
yield from new_ids
|
yield from new_ids
|
||||||
except (exceptions.NoVideos, exceptions.RSSAssistFailed) as exc:
|
except (exceptions.NoVideos, exceptions.RSSAssistFailed) as exc:
|
||||||
log.debug(
|
log.debug(
|
||||||
'RSS assist for %s failed "%s", using traditional refresh.',
|
'RSS assist for %s failed "%s", adding to traditional queue.',
|
||||||
channel.id,
|
channel.id,
|
||||||
exc.error_message
|
exc.error_message
|
||||||
)
|
)
|
||||||
traditional(channel)
|
need_traditional.append(channel)
|
||||||
|
|
||||||
video_ids = lazychain.LazyChain()
|
video_ids = lazychain.LazyChain()
|
||||||
|
|
||||||
|
@ -153,6 +155,10 @@ class YCDLDBChannelMixin:
|
||||||
for video in self.youtube.get_videos(video_ids):
|
for video in self.youtube.get_videos(video_ids):
|
||||||
self.ingest_video(video)
|
self.ingest_video(video)
|
||||||
|
|
||||||
|
for channel in need_traditional:
|
||||||
|
log.debug('Using traditional refresh for %s.', channel.id)
|
||||||
|
traditional(channel)
|
||||||
|
|
||||||
return excs
|
return excs
|
||||||
|
|
||||||
@worms.atomic
|
@worms.atomic
|
||||||
|
|
Loading…
Reference in a new issue