24
Views
1
Comments
Thread was being aborted
Discussion

Hello community!

We are facing a problem related to this topic and would like to hear from anyone who has had a similar problem.

Our scenario: We have a timer that processes items and makes some calls to external REST APIs.

Some (intermittent) calls are generating the error "Thread was being aborted", causing this error to be raised to the Timer thread and interrupting its execution.

Is there any way to handle this error without resorting to lower-level alternatives in the platform?

2016-04-22 00-29-45
Nuno Reis
 
MVP

Hello.

Here is an option:

Your timer starts an Action A with a loop.

Action A does a fetch from database and calls Action B for each item.

Action B is the one calling the API. The error handler will return any breaking error in ActionB as a simple Success=False output to ActionA, instead of Success=True.

Action A will not update current item to Complete status, but will still move forward to the next one.

When the loop ends, the timer just needs wake up again to check for pending items and retry the ones that missed.

When the fetch is empty, the work is done and timer can end.


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.