handle reindex item delete during task run

This commit is contained in:
Simon 2023-12-21 13:22:05 +07:00
parent fe8f4faa10
commit 14e23a4371
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4
1 changed files with 9 additions and 0 deletions

View File

@ -292,6 +292,9 @@ class Reindex(ReindexBase):
# read current state
video.get_from_es()
if not video.json_data():
return
es_meta = video.json_data.copy()
# get new
@ -329,6 +332,9 @@ class Reindex(ReindexBase):
# read current state
channel = YoutubeChannel(channel_id)
channel.get_from_es()
if not channel.json_data:
return
es_meta = channel.json_data.copy()
# get new
@ -357,6 +363,9 @@ class Reindex(ReindexBase):
self._get_all_videos()
playlist = YoutubePlaylist(playlist_id)
playlist.get_from_es()
if not playlist.json_data:
return
subscribed = playlist.json_data["playlist_subscribed"]
playlist.all_youtube_ids = self.all_indexed_ids
playlist.build_json(scrape=True)