#Worker received too many subrequests?

12 messages · Page 1 of 1 (latest)

jade jasper
#

I am running into an error that I have too many subrequests for my worker. Wondering if it has to do with the way my worker is consuming from a queue? I was using an iterative loop but maybe there is a better way? Any ideas?

stuck knoll
#

Well if you perform greater than 50 fetches in one worker invocation you'll get that error

#

You can switch to unbound to raise it to 1000, but you'll be billed based on how long the worker takes to run instead of 1 unit per invocation from bundled

#

You could solve this by restricting your queues max batch size to fit within the 50 fetch limit

jade jasper
#

Still rocking the same error. Do calls to INSERT into D1 count as subrequests?

stuck knoll
#

Interacting with most bindings will make a http request, yes

jade jasper
#

Okay, so, my worker script uses 2 requests - 1 fetch and 1 post to D1. I set the max batch size on my queue to 20 and am still getting the same error. Any ideas?

stuck knoll
#

Could you share the code?

jade jasper
stuck knoll
#

That doesn't look like it should hit 50 🤔