Workers and cron
Run code besides the web: a worker that runs all the time (a queue, a bot), or a cron entry that runs on a schedule (a nightly report), declared in the manifest.
An App's code runs as Processes on its machine. There is always one web Process, which answers HTTP. You can add others in basemodo.toml, and they share the same machine, disk, database and Secrets.
Workers
A worker runs continuously beside web, and is restarted if it stops.
[[worker]]name = "mailer"command = "node mailer.js"Repeat [[worker]] for several. A worker keeps the App awake: an App with one never sleeps, so workers come with the Plans that allow Apps to stay on (see Plans). A worker that stops is restarted after a pause that doubles each time (1 second up to a minute). One that keeps crashing (eight quick exits in a row) is left stopped and the App is paused: you are told why, basemodo status says paused with the reason, and the next Deploy resumes it. Each line a worker prints reaches the Logs with its name in front: [mailer] sent 3 emails.
Keys: worker.name, worker.command.
Cron
A cron entry runs a command on a schedule.
[[cron]]name = "nightly-report"schedule = "0 3 * * *"command = "node report.js"timezone = "America/Bogota"timeout = "5m"schedulehas five fields: minute, hour, day of the month, month, day of the week.0 3 * * *is every day at 03:00;*/15 * * * *every 15 minutes;0 9 * * 1Mondays at 09:00.- It is read in UTC unless you give a
timezone(an IANA name, likeEurope/Madrid). - A run may take 15 minutes unless you give a
timeout(30s,5m,2h; at most24h); then it is stopped. - Runs never overlap: if the previous run is still going when the next is due, the next one is skipped (the Logs say so).
- A sleeping App is woken for its run.
- Each run's output and exit code go into the App's Logs.
- On Pro and Workspace Plans, a run that fails or times out is tried again up to 3 times, after 1, 2 and 4 minutes; the Logs say when (see Plans).
Repeat [[cron]] for several. Names must be unique among workers and cron entries, and cannot be web.
Keys: cron.schedule, cron.timezone, cron.timeout, and the rest on the manifest's page.