Skip to content

Commit

Permalink
delete pit to be used without composite
Browse files Browse the repository at this point in the history
  • Loading branch information
Arpit-Bandejiya committed Aug 23, 2022
1 parent 5b188f9 commit b595f46
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions osbenchmark/worker_coordinator/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -1866,14 +1866,17 @@ def __repr__(self, *args, **kwargs):

class DeletePointInTime(Runner):
async def __call__(self, opensearch, params):
pit_op = mandatory(params, "with-point-in-time-from", self)
pit_id = CompositeContext.get(pit_op)
pit_op = params.get("with-point-in-time-from", None)
request_params = params.get("request-params", {})
body = {
"pit_id": [pit_id]
}
await opensearch.delete_point_in_time(body=body, params=request_params, headers=None)
CompositeContext.remove(pit_op)
if pit_op is None:
await opensearch.delete_point_in_time(all="_all", params=request_params)
else:
pit_id = CompositeContext.get(pit_op)
body = {
"pit_id": [pit_id]
}
await opensearch.delete_point_in_time(body=body, params=request_params, headers=None)
CompositeContext.remove(pit_op)

def __repr__(self, *args, **kwargs):
return "delete-point-in-time"
Expand Down

0 comments on commit b595f46

Please sign in to comment.