35
Views
5
Comments
doing a loop batch by batch
Question
Application Type
Service
Service Studio Version
11.55.13 (Build 64030)
Platform Version
11.34.0 (Build 44666)

im creating a many sending request on an api since it cant do send request many at one time im doing the only way is to loop but to avoid doing too many request api error im doing sending only 10 rquest and do sleep then send another 10 is there a way on how to properly do it? thanks!

testforBulkroders.oml
2016-04-22 00-29-45
Nuno Reis
 
MVP

Hello.

That strategy was recommended a few years ago.

https://www.outsystems.com/forums/discussion/68656/create-a-timed-action-to-get-api-rest-data/#


If you are doing with a timer, assuming you have some attribute to mark the ones already send and don't repeat work, you can end the timer and wake it again, it will give a few seconds to rest.


If you are doing from the client side, I would use JavaScript's SetInterval to update status of previous call before calling again. This way user is always informed of status (instead of just waiting) and calls are spaced a few seconds.

UserImage.jpg
jesu verso

this deosnt resolve on my part

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

I gave 3 possible solutions. None of those work? Why? What is your particular scenario?

UserImage.jpg
jesu verso

the 2nd one you gave is too general, but thanks!

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

Because  there are several resources on that:

Both official courses:

https://learn.outsystems.com/training/journeys/async-processing-timers-586

And community events:

https://usergroups.outsystems.com/events/details/outsystems-inc-chennai-presents-masterclass-11-batch-processing-using-timers


I could try to explain how to set it up in a post, but it takes an hour to do it properly.

Your timer will be like this.

You search for the records not sent. Send them. Save each into database. Mark the timer to wake up and end it.

A few seconds later, the timer will restart and do it again until there is no more data.



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