Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Usage Milestone: Google Analytics Module google_analytics crossed 1,000 active installs. Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Release: GraphQL Compose Codegen 1.1.2 Minor update available for module graphql_compose_codegen (1.1.2). Release: Mapy.com 1.1.3 Minor update available for module mapycom (1.1.3). Release: Ckeditor5 entity browser 3.0.3 Minor update available for module ckeditor5_entity_browser (3.0.3). Release: Ckeditor5 entity browser 3.0.1 Minor update available for module ckeditor5_entity_browser (3.0.1). Release: Ckeditor5 entity browser 3.0.2 Minor update available for module ckeditor5_entity_browser (3.0.2). Release: Teamleader Integration 4.0.2 Minor update available for module teamleader (4.0.2). Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Sleepy Cron

5 sites Security covered Drupal 10–11
View on drupal.org

This module saves server resources by preventing cron jobs from running on inactive websites. It tracks website usage and only runs cron when the site is accessed again, ensuring resources are conserved for test instances or infrequently used sites.

This module aims to preserve server resources (processors, memory, thus electricity) by not running the cron on websites that are not used.

This is pointless on a classic production website, which is expected to be used regularly.

But it can be useful for test instances on test servers. Some agencies run many test instances for many branches of many websites. In that case, running the cron can take much resources, especially if it's run every minute (which sometimes is needed to ensure reverse proxy cache invalidation). Even if the cron has nothing to do (for example because jobs are scheduled thanks to Ultimate cron), it still bootstraps Drupal.

It can also be useful for anonymously-used websites which are behind a reverse proxy such as Varnish and hardly ever change. In that case, most of the time, the pages are served from the reverse proxy cache, and PHP is not used. Then the resources consumed can be greatly reduced if what still uses PHP (i.e. cron) does not run.

Now you may wonder: for such cases, why not just use the core automated cron (previously known as "Poorman's cron"), and no crontab?
Because sometimes, even on test websites, you need the cron to trigger very regularly at the time the website is being used (for example, to send invalidations to reverse proxy cache, or more generally to process a queue). And because, when the website is used again, you want the first page requested to show up-to-date data, not stale data that will be refreshed only after cron.

Features

This module stores the latest time the website has been visited. If it's a long time ago, the cron "falls asleep". Then the cron process is prevented, until the website is visited again. At that time, the cron is run once before the page is built, and a warning message is shown (if the triggering user has the permission to see it) to tell that the cron has not run for a long time.

For more info, see the README.md file.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
3
Tracked since
Oct 2024
Latest release
8 months ago
Releases (12 mo)
1 ▼ from 2
Maintenance
Active

Release Timeline

Releases

Version Type Core Release date
1.0.1 Stable 10–11 Dec 5, 2025
1.0.0 Stable 10–11 Mar 24, 2025
1.0.0-beta2 Pre-release 10–11 Oct 7, 2024