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
Walshy
Walshy•3mo ago
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
LukeZ
LukeZOP•3mo ago
Ah, makes sense. where can I see the CPU analytics?
LukeZ
LukeZOP•3mo ago
wait, the error is actually "too many subrequests". How can this occur?
No description
LukeZ
LukeZOP•3mo ago
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.
LukeZ
LukeZOP•3mo ago
also, just looking at this log - I think it "may have" exceeded 5 minutes lol
No description
Walshy
Walshy•3mo ago
Too many subrequests happens when you do over 1000 subrequests Which is also a lot 😅
LukeZ
LukeZOP•3mo ago
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 ^^

Did you find this page helpful?