Rate limit 10 per minute

Is it possible to enque an action and somehow handle rate limiting if the api endpoint only alows 10 per minute?
17 Replies
Jay
JayOP8mo ago
dummy solution is to make sure each action takes at least x seconds long
Chocci_Milk
Chocci_Milk8mo ago
Hello, Why would you not instead have a global action on a schedule and make records to track which action should be run next? Then you can run the scheduled action every 10 minutes and use findFirst with some filters to know which action to run Whats the use case?
Jay
JayOP8mo ago
Using an external system to send SMS messages with attachments We’re sending the same message to a list of subscribers
Chocci_Milk
Chocci_Milk8mo ago
Does my idea help you in that case?
Jay
JayOP8mo ago
Can you explain it a bit better?
Chocci_Milk
Chocci_Milk8mo ago
How is that action setup to run? Do you pass a bunch of emails to it or is it one email at a time and there's other code that needs to run additionally?
Jay
JayOP8mo ago
I have one action that gathers all the subscribers from a data model and cues an action for each subscriber The first action is triggered by a webhook
Chocci_Milk
Chocci_Milk8mo ago
Ok, and you want the triggered actions to be run every 10 minutes why exactly?
Jay
JayOP8mo ago
I think you need to reread my original posts. It may not have been clear.
Chocci_Milk
Chocci_Milk8mo ago
I'm just trying to understand, sorry for all the questions
Jay
JayOP8mo ago
The rate limit is 10 messages per minute
Chocci_Milk
Chocci_Milk8mo ago
Oups! True, got my wires crossed Ok, either way the flow should go as follows Don't enqueue the actions - Make a model that holds a batch of users, and a ran boolean - Make records for each batch - Make a scheduled action that runs every minute - Fetch the first record from that model (filtered for if it ran or not) - Make the api calls in the action
Jay
JayOP8mo ago
Why is that more efficient than equeing actions?
Chocci_Milk
Chocci_Milk8mo ago
You can’t enqueue to run things for a minute range concurrency. You can only enqueue concurrency for a duration of a second
Jay
JayOP8mo ago
Should the batch model contatin static users or should it have a connect to the subscribers model?
Chocci_Milk
Chocci_Milk8mo ago
If you’re going to make a record per batch, I would say that it should be a static field
Jay
JayOP8mo ago
thanks!

Did you find this page helpful?