Hello everyone. I looked through the similar topics but could not find advice specifically around iterator based executions. I am making a call to Discord to retrieve all the messages in a certain channel and delete them each hour, then call a different scenario to post new messages to replace them with updated data (think of it like a Scorecard). BUT when my scenario iterates over 7 bundles of messages to delete, I keep getting “rate limited” by Discord. I would like to tell the scenario to pause for 5 seconds between deleting each message. Is this possible? I did add a Break/Retry so when the 7th message failed to delete, it tries again in one minute and it works fine. But I would prefer to just run the delete calls every few seconds which I think will avoid hitting the rate limit to begin with? Thanks for your input/advice.
Also it felt very hacky but the ending HTTP request was being triggered as many times as there were messages to delete. I solved it by filtering on “Bundle Position = Number of Bundles” which works fine, but probalby not the most straightforward?
There is a sleep module you can use in the Tools drawer. Just search for sleep when adding a module.
Thanks you @alex.newpath. But how do I place the “Tools/Sleep” module within the iteration? In my diagram the first Discord module extracts 7-10 messages then the second one deletes them in a series, it acts like its own iterator. So I am not sure how to place the “Sleep” inside that iteration loop when it it is just one module?
This doesn’t look right to me, not does using the Iterator. How do I know when the repeater “loop” ends?
You could add a Router and give it 2 or 3 branches with the same apps, but at the end or beginning of each branch, add the Tools > Sleep app checking 2-3 bundles
It would look similar to this.
I had to do something similar with Google Maps so it doesn’t error out with too many requests. I have a screenshot that shows it. 87 apps & 338 Operations to create a personal city data report - #3 by WilliamS
If you are getting multiple bundles out of the discord module that will naturally run the modules afterwards. If you put a sleep module after it, during the execution of each bundle, whereever the sleep module is it will sleep each time thus “slowing down” the execution of your scenario and hitting the next Discord module which deletes messages.
I am not sure why you need an iterator though…
Ok @alex.newpath yes I completely was overthinking it and this worked perfectly! I set it to sleep for 3 seconds between each bundle and no “rate limit” errors being hit! Cheers.