Skip to content

feat: Crons#2922

Open
arnauorriols wants to merge 7 commits intomainfrom
crons
Open

feat: Crons#2922
arnauorriols wants to merge 7 commits intomainfrom
crons

Conversation

@arnauorriols
Copy link
Member

@arnauorriols arnauorriols commented Feb 20, 2026

@arnauorriols
Copy link
Member Author

arnauorriols commented Feb 23, 2026

  • Be more explicit about crons being scheduled to each timeline right after explaining how to declare them.

deploy/_data.ts Outdated
Comment on lines 50 to 51
title: "Crons",
href: "/deploy/reference/crons/",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cron or crons?

Copy link
Member Author

@arnauorriols arnauorriols Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cron jobs?

@@ -0,0 +1,138 @@
---
title: Crons
Copy link
Member

@philhawksworth philhawksworth Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason for us calling this feature Crons instead of Cron?

Cron feels more correct, with the descriptive plural form being "cron tasks" or "cron jobs" as we've used in the past and seems to be the wider norm

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't really given it any thought. Now that you mention it though, my preference would be Cron Jobs.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

However, if we go with "Cron Jobs", we should update the UI accordingly. @donjo

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the feature should be Cron and that the UI should correspond. In prose and where we are talking about multiple registered cron items, "cron jobs" seems standard and appropriately descriptive

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds right to me, we can update the UI accordingly to match what is being proposed here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed feature to "Cron", and normalized all references in text to "cron job(s)". See e71d5bc


Cron executions progress through these statuses:

| Status | Color | Description |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This traffic light status description appears before any mention of a UI in the console. Should the existence of the cron dashboard be mentioned first so that this is more meaningful?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could just remove the color column? it does not add much value.

The **Crons** tab in the app sidebar gives you an overview of all registered
crons across your project. Each entry shows the cron's schedule, its most recent
executions, and the active [timelines](/deploy/reference/timelines/) it belongs
to. When a cron with the same name is registered with different schedules on
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if an attempt to use the same name is made on a single timeline?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand what you mean

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a description here of what happens if the same name for a cron job is used in different timelines. I curious to know what happens if the sane name is used twice, perhaps in error, in a single timeline.

Deno.cron("cleanup-old-data", "0 * * * *", () => {
  console.log("Cleaning up old data...");
});

//....

Deno.cron("cleanup-old-data", "6 * * * *", () => {
  console.log("Cleaning up other old data...");
});

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh. That's a runtime error, and your revision will fail to warmup.

## Limitations

- Crons must be registered at the module top level (before `Deno.serve()`)
- No concurrent executions of the same cron
Copy link
Member

@philhawksworth philhawksworth Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • No concurrent executions of the same cron

What exactly does that mean? Could we be a tiny bit more descriptive here in the interest of driving out any ambiguity?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly, besides the billing point, the rest are already explained in length above. I'm considering removing the section alltogether, and adding a billing section explaining how billing works

Copy link
Member

@philhawksworth philhawksworth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good!

I've added some questions and comments.

A fundamental one is about the naming of this as Crons vs Cron, which might bring about the need for a few edits for consistency depending on what is decided.

Copy link
Member

@philhawksworth philhawksworth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGMT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants