I have the code like below:
Queue queue = QueueFactory.getDefaultQueue();
queue.add(TaskOptions.Builder.withRetryOptions(
RetryOptions.Builder
.withTaskRetryLimit(0)));
With this code the task will not retry if not an error. However, what I want to do is run another function call onRetryFailure() when 10 minutes have passed( the maximum time before retry). Any idea how i can do so?
It's not very clear under what conditions you want this
onRetryFailure()function to run. You could:onRetryFailure()to be called for any error, you could wrap up your current task code in a try-catch and launchonRetryFailure()as another taskonRetryFailure()to be called only when you hit the 10 minute time limit, at the start of your task you could addonRetryFailure()as another task with a 10 minute countdown and at the end of your task you could deleteonRetryFailure()from the queue if you no longer want it to run https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/Queue.html#deleteTask-java.util.List-