0

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?

CloudSeph
  • 863
  • 4
  • 15
  • 36
  • Do you want something like error handling? A function that get executed when 10 minutes pass? I don't fully understand your question. – J.L Valtueña Jul 13 '18 at 10:23
  • @J.LValtueña basically the idea is like a try catch. i want to catch when task retry limit is reached to run a function. – CloudSeph Jul 16 '18 at 02:03

1 Answers1

1

It's not very clear under what conditions you want this onRetryFailure() function to run. You could:

Alex
  • 5,141
  • 12
  • 26
  • For the second comment, I can't do that as only if queue passes the 10 minute mark should it run. Otherwise, it should not. Basically, if the queue is successful and does not pass 10 mins. I dont want it to run. But doing it like what you said will run after 10 mins regardless of success or failure – CloudSeph Jul 12 '18 at 13:53