force refresh for new videos to avoid racing condition

This commit is contained in:
simon 2021-11-19 16:26:05 +07:00
parent 3b6e70b4dc
commit fef26a06b2
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4

View File

@ -408,7 +408,7 @@ class YoutubeVideo:
def upload_to_es(self):
"""upload channel data to elastic search"""
url = f"{self.ES_URL}/ta_video/_doc/{self.youtube_id}"
url = f"{self.ES_URL}/ta_video/_doc/{self.youtube_id}/?refresh=true"
response = requests.put(url, json=self.vid_dict, auth=self.ES_AUTH)
if not response.ok:
print(response.text)