Cron Exceeded CPU Limit

I have a cron that's getting a Exceeded CPU Limit error around the 30s mark. The code simply does DB fetch requests and should not be using this much CPU time, unsure why it does. However besides that issue the worker CPU time limit should be 15 minutes, not 30 seconds. Why does the cron request not run for longer? This is the error I see in wrangler tail logs:
"*/5 * * * *" @ 9/6/2024, 12:40:11 AM - Exceeded CPU Limit
"*/5 * * * *" @ 9/6/2024, 12:40:11 AM - Exceeded CPU Limit
No description
2 Replies
Chaika
Chaika3mo ago
Scheduled Workers (Cron Triggers) have different limits on CPU time based on the schedule interval. When the schedule interval is less than 1 hour, a Scheduled Worker may run for up to 30 seconds. When the schedule interval is more than 1 hour, a scheduled Worker may run for up to 15 minutes.
https://developers.cloudflare.com/workers/platform/limits/ weird that your worker would be taking so long for a simple db fetch though, should be mostly waiting on i/o which doesn't count for cpu time, depends exactly how you're doing it though
sakura
sakuraOP3mo ago
Ah I missed that, thank you I'm using drizzle-orm/planetscale-serverless with @planetscale/database fetch setup. I'll check if there's anything unexpected going on there
Want results from more Discord servers?
Add your server