mirror of
https://git.vectorsigma.ru/public/tubearchivist.git
synced 2026-08-04 21:39:49 +00:00
fix priority bulk download
This commit is contained in:
@@ -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"""
|
||||||
|
|||||||
Reference in New Issue
Block a user