R
Runpod12mo ago
NGTK

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.
1 Reply
Unknown User
Unknown User11mo ago
Message Not Public
Sign In & Join Server To View

Did you find this page helpful?