#429 Too Many Requests with useRealtimeRun

1 messages · Page 1 of 1 (latest)

formal charm
#

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

formal charm
#

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?

jaunty lion
#

Is each of your runs a separate hook? Or are you passing an array of runs/using a tag?

formal charm
#

Each one is a separate hook, i think useRealtimeRun only accepts one runID. by array of runs do you mean using useRealtimeBatch?

jaunty lion
#

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

Trigger.dev

Tags allow you to easily filter runs in the dashboard and when using the SDK.

Trigger.dev

Using the Trigger.dev v3 API from your React application.

native lantern
#

@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

formal charm
#

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?

jaunty lion
#

@raw imp what’s your recommendation for realtime here? Tags?

raw imp
raw imp