github encoredev/encore v0.19.0
It's about time — Cron Jobs are here!

latest releases: v1.4.0, v1.3.1, v1.3.0...
2 years ago

When building backend applications you often need to run periodic and recurring tasks. For example, to send a welcome email to everyone who signed up recently. Encore provides native support for these types of use cases using Cron Jobs. Here's how easy it is:

import "encore.dev/cron"

// Send a welcome email to everyone who signed up in the last two hours.
var _ = cron.NewJob("welcome-email", cron.JobConfig{
    Title:    "Send welcome emails",
    Every:    2 * cron.Hour,
    Endpoint: SendWelcomeEmail,
})

That's it! When this is deployed, the Encore Platform will call the SendWelcomeEmail endpoint (not pictured) every 2 hours. There is no need to maintain any infrastructure; Encore itself takes care of the scheduling, monitoring and execution. Hooray! ✨

What's more, Encore's web platform has a shiny new Cron Jobs dashboard to help you keep track of all your jobs. Check it out:

Cron Job dashboard

This means you can now schedule recurring tasks without worrying about:

  • How yet another configuration language works –– it's just plain Go.
  • Setting up and maintaining servers or third-party services –– it's all handled by Encore.
  • Keeping track of what jobs are running in each environment – just check the dashboard!

To get started, install the latest Encore release with encore version update and upgrade your application's dependency with go get encore.dev@latest.

Check out the docs 📚 to learn more.

Bugfixes and other improvements

Thanks to @ValeriaVG and @wisdommatt for the contributions!

Don't miss a new encore release

NewReleases is sending notifications on new releases.