Menu

Our app has 601 serverless invocations a day and exactly one background task, and the task gets 1,800 seconds
📰

Our app has 601 serverless invocations a day and exactly one background task, and the task gets 1,800 seconds

DEV Community: typescript·Daniel Pertu·16 days ago
#NCUvmDLh
#devtotypescript#devto#dev#task#second
Reading 0:00
15s threshold

Nakodo runs almost everything on a schedule. Four cron entries, 601 invocations a day, all of them ordinary serverless functions with a 300-second ceiling, each one claiming a batch of work from a Postgres queue and doing as much of it as it can before the clock runs out.

There is one job that does not fit in 300 seconds, and it runs somewhere else. This is the whole of the configuration that puts it there:

import { defineConfig } from " @trigger.dev/sdk " ;

// Trigger.dev runs the work too long or heavy for a Vercel function: importing // businesses from Overture Maps' places files (src/trigger). Everything else // stays in the cron pipeline. export default defineConfig ({ // The project's ref, from the Trigger.dev dashboard. Not a secret. project : process . env . TRIGGER_PROJECT_REF ?? " your-project-ref " , dirs : [ " ./src/trigger " ], runtime : " node-24 " , // A whole country's places can take several minutes to read.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.