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
dummy solution is to make sure each action takes at least x seconds long
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?
Using an external system to send SMS messages with attachments
We’re sending the same message to a list of subscribers
Does my idea help you in that case?
Can you explain it a bit better?
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?
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
Ok, and you want the triggered actions to be run every 10 minutes why exactly?
I think you need to reread my original posts. It may not have been clear.
I'm just trying to understand, sorry for all the questions
The rate limit is 10 messages per minute
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
Why is that more efficient than equeing actions?
You can’t enqueue to run things for a minute range concurrency. You can only enqueue concurrency for a duration of a second
Should the batch model contatin static users or should it have a connect to the subscribers model?
If you’re going to make a record per batch, I would say that it should be a static field
thanks!