fix priority bulk download

This commit is contained in:
Simon
2025-07-06 20:55:04 +07:00
parent 74c708baa2
commit 66f37a92d3

View File

@@ -125,18 +125,22 @@ class PendingInteract:
if vid_type: if vid_type:
must_list.append({"term": {"vid_type": {"value": vid_type}}}) must_list.append({"term": {"vid_type": {"value": vid_type}}})
if new_status == "priority":
source = """
ctx._source.status = 'pending';
ctx._source.auto_start = true;
ctx._source.message = null;
"""
else:
source = f"ctx._source.status = '{new_status}'"
data = { data = {
"query": {"bool": {"must": must_list}}, "query": {"bool": {"must": must_list}},
"script": { "script": {"source": source, "lang": "painless"},
"source": f"ctx._source.status = '{new_status}'",
"lang": "painless",
},
} }
print(data)
path = "ta_download/_update_by_query?refresh=true" path = "ta_download/_update_by_query?refresh=true"
response, status_code = ElasticWrap(path).post(data) _, _ = ElasticWrap(path).post(data)
print(status_code)
print(response)
def update_status(self): def update_status(self):
"""update status of pending item""" """update status of pending item"""