Skip to content

[6.x] Add config to disable HandleEntrySchedule job - #15103

Merged
jasonvarga merged 1 commit into
6.xfrom
handle-scheduled-entries
Aug 3, 2026
Merged

[6.x] Add config to disable HandleEntrySchedule job#15103
jasonvarga merged 1 commit into
6.xfrom
handle-scheduled-entries

Conversation

@duncanmcclean

@duncanmcclean duncanmcclean commented Aug 3, 2026

Copy link
Copy Markdown
Member

This pull request adds a handle_scheduled_entries config option, which allows the HandleEntrySchedule scheduled task to be disabled.

Statamic registers this scheduled job unconditionally, and runs it every minute:

$this->app->make(Schedule::class)->job(HandleEntrySchedule::class)->everyMinute();

It's fine on traditional hosting, but becomes a problem on usage-billed platforms (like Laravel Cloud or Vapor) as it means the application's resources need to boot every 60 seconds to run the job, whether or not the site has a single scheduled entry.

This PR adds a config option so those sites can opt out:

'handle_scheduled_entries' => env('STATAMIC_HANDLE_SCHEDULED_ENTRIES', true),

Disabling the job won't prevent entries from being published on time. Entry::status() derives scheduled from the entry's date on every read, so an entry goes live either way. The job only dispatches EntryScheduleReached, which invalidates the static cache and updates search indexes — so what you lose is those two staying in sync until something else touches the entry.

The original request asked for a configurable frequency rather than an on/off switch. I've gone with a boolean because the two aren't equivalent — MinuteEntries looks at exactly one minute, so running the task every fifteen minutes would skip fourteen of them rather than publishing late. Supporting a frequency means reworking the job to sweep the whole elapsed interval and persist its last run, which felt like more than this needed. A boolean can widen to accept a frequency later without a breaking change.

Closes statamic/ideas#1476

Allows the `HandleEntrySchedule` scheduled task to be disabled, so sites
on usage-billed serverless infrastructure aren't kept awake every minute.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@duncanmcclean duncanmcclean changed the title [6.x] Add config to disable HandleEntrySchedule jobs [6.x] Add config to disable HandleEntrySchedule job Aug 3, 2026
@jasonvarga
jasonvarga merged commit acfa87c into 6.x Aug 3, 2026
25 checks passed
@jasonvarga
jasonvarga deleted the handle-scheduled-entries branch August 3, 2026 18:22
@4rn0

4rn0 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Lovely gents!

duncanmcclean added a commit to statamic/docs that referenced this pull request Aug 6, 2026
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.

Make the HandleEntrySchedule frequency configurable

3 participants