Hi team,
Huge fan of v3, we recently switched to cloud. I'm trying to show the status of multiple runs from my frontend with useRealtimeRun, but noticing a lot of rate limit errors it looks like. I have maybe 50 run ids on a page and am trying to show the status for each. Is this expected or is this not a recommended pattern? Thanks
#429 Too Many Requests with useRealtimeRun
1 messages · Page 1 of 1 (latest)
I think I am getting blocked by Cloudflare now on the CLI and think it might be a result of this 😅 am I using useRealtimeRun correctly?
Is each of your runs a separate hook? Or are you passing an array of runs/using a tag?
Each one is a separate hook, i think useRealtimeRun only accepts one runID. by array of runs do you mean using useRealtimeBatch?
Ah yes you're right, it only takes a single run id. Batch will only work if you used batchTrigger.
A better option would probably be to use tags in your runs and then use
@raw imp useful for you to be aware of this
@formal charm were you able to figure this out? Did you end up switching to useRealtimeBatch? I have a use case similar to yours and getting same thing. I was trying using useRealtimeBatch at first but it never worked for me. Server errors.
Actually, I might just use what Matt suggested with useRealtimeRunsWithTag
Nope @native lantern I switched to use useRun for now with a high polling internval (5s). If rate limiting is the issue I'm not sure if using the other hooks will help since they also will hit the API the same # of times I'm assuming?
@raw imp what’s your recommendation for realtime here? Tags?
The realtime API doen't go through the same rate limiter as the rest of the API. There is a limit to how many concurrent realtime connections that are live at once, depending on your plan (if you are using cloud). I just realized we haven't actually published those limits to the pricing page but they are currently:
Free: 10
Hobby: 25
Pro: 100
These are just our preliminary rate limits for now as we test the system in beta