From fef26a06b241309aa57593514f6e31942223f33c Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 19 Nov 2021 16:26:05 +0700 Subject: [PATCH] force refresh for new videos to avoid racing condition --- tubearchivist/home/src/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tubearchivist/home/src/index.py b/tubearchivist/home/src/index.py index 6e93d3f..382cc78 100644 --- a/tubearchivist/home/src/index.py +++ b/tubearchivist/home/src/index.py @@ -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)