Skip to content

New: add filters to widen action schedulers cleanup#24

Merged
brettsmason merged 6 commits into
mainfrom
feature/action-scheduler-filters
Oct 30, 2025
Merged

New: add filters to widen action schedulers cleanup#24
brettsmason merged 6 commits into
mainfrom
feature/action-scheduler-filters

Conversation

@DanielHudson2

@DanielHudson2 DanielHudson2 commented Oct 9, 2025

Copy link
Copy Markdown
Member

Added filters for:

  • action_scheduler_retention_period (the period actions need to be older than in order to be deleted), set this to WEEK_IN_SECONDS * 4 as a default but can be overridden with orbit_action_scheduler_retention_period
  • action_scheduler_default_cleaner_statuses set this to [ 'complete', 'canceled', 'failed' ] as default and can be overridden with orbit_action_scheduler_default_cleaner_statuses
  • action_scheduler_cleanup_batch_size set this to be 1000 as default and can be overridden with orbit_action_scheduler_cleanup_batch_size

Something we need to review is the retention period, we discussed doing one month (which is actually the Action Scheduler default) but its not cleaning enough actions for what we were hoping to see, there just seems to be a lot of actions from woocommerce and its plugins e.g. MailChimp_WooCommerce_Single_Order has a lot of actions on it

This can vary depending on how busy the site is, so maybe we need to keep the 1 month default and review on a case by case basis the larger sites and consider reducing it for ones that still have a lot in their log.

@DanielHudson2 DanielHudson2 self-assigned this Oct 9, 2025
@DanielHudson2 DanielHudson2 added the enhancement New feature or request label Oct 9, 2025
@brettsmason

Copy link
Copy Markdown
Member

@edjeavons What do you think about reducing the clean up schedule to 2 weeks by default?
Especially completed tasks, we really dont need to know that its been completed with that sort of retention period.

@edjeavons

Copy link
Copy Markdown
Member

Two weeks is sufficient. I can't think of any examples when we've needed to look back any further, and if something ever comes up we do have backups that we can restore in an emergency.

It would be ideal if we could vary the retention period (e.g. delete completed jobs after a week but keep cancelled & failed job for a month) but WooCommerce core doesn't offer that.

@edjeavons edjeavons left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

All good to merge if you're happy with my commits.

I merged the latest main branch changes into this one so it could be tested on that basis before completing PR. That led to a few more lib files being added that aren't really relevant but will be added sooner or later anyway.

@brettsmason brettsmason merged commit f188ea7 into main Oct 30, 2025
@DanielHudson2 DanielHudson2 deleted the feature/action-scheduler-filters branch October 30, 2025 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants