NGTK
RRunPod
•Created by NGTK on 11/25/2024 in #⚡|serverless
How to cancel request
Here is my python code for running the request.
#############
run_request = endpoint.run(input_payload)
# Initial check without blocking, useful for quick tasks
status = run_request.status()
print(f"Initial job status: {status}")
if status != "COMPLETED":
# Polling with timeout for long-running tasks
return run_request.output(timeout=80)
else:
return run_request.output()
#############
I just want to know how to cancel the request if the timeout happens using run_request.cancel()
Currently the request stops execution and throws an error message if timeout exceeds but sometimes the request still exists in the delay queue resulting in increased costs.
4 replies
RRunPod
•Created by NGTK on 10/12/2024 in #⚡|serverless
Huge sudden delay times in serverless
12 replies