Worker exceeding CPU limit?
I'm not quite sure why, but my code runs fine on my PC (in dev mode) but the Worker is always failing because of an exceeded CPU limit?
Any idea why?
- https://github.com/The-LukeZ/twitter-x-discord-forwarder/blob/master/src/index.ts
GitHub
twitter-x-discord-forwarder/src/index.ts at master · The-LukeZ/twi...
Contribute to The-LukeZ/twitter-x-discord-forwarder development by creating an account on GitHub.
7 Replies
Local dev doesn't enforce CPU limit - how much CPU are your requests using and free plan? Paid has up to 5 minutes, basically impossible to exceed
Ah, makes sense.
where can I see the CPU analytics?
wait, the error is actually "too many subrequests". How can this occur?

Looking at the error I think it's because of the usage of Discord JS in
buildDiscordPayload. Let me try to turn that into a manual fetch call.also, just looking at this log - I think it "may have" exceeded 5 minutes lol

Too many subrequests happens when you do over 1000 subrequests
Which is also a lot 😅
jesus. Funny thing is, if it now works - I'm sure discord.js has issues definitely. Because I can't use discord.js stuff in my svelte frontend - it seems to use stuff that breaks something.
Could be the same reason why its throwing things at me with Workers.
I'm just waiting for my logs. They take very long to arrive (or its timing out again)
okay, it seems to work now. Sadly, the Discord webhooks is on a ratelimit (because I didn't implement a sufficient ratelimiting handler before so it fired like 19 requests in 5 seconds - which hits the ratelimit)
Thanks mate, I think its solved now ^^