action-scheduler
action-scheduler copied to clipboard
Add method for purging failed actions
The automatic purge deleted completed & canceled actions but leaves the failed ones behind for troubleshooting. We should add a user intervention method to remove these.
add a user intervention
@rrennick Were you thinking this would be an interface or setting, or a filter or constant?
Were you thinking this would be an interface or setting, or a filter or constant?
@crstauf It was mostly a note to remind me to think about it later :)
AS currently doesn't use global constants and doesn't have a settings screen. Filters might work if they took into account that the desired purge delay might be different for different statuses. Another alternative might be write a small plugin with a scheduled action and add the code and instructions to the documentation.
+1 for this feature. As a WC user, would like to see a button on the admin area to "Purge all" failed actions. I have 91671 failed actions right now and it lists 10 actions per page. So the current "bulk" delete method is useless in my case.
The oldest action is from 2019-08-14.
A filter will also do the job for me to set an interval to delete them automatically.
Thank you!
+1! Or a wp CLI action that cleans up all completed/failed/cancelled actions. Also very useful in development.
In addition to manually triggered solutions (whether admin UI or WP CLI-based), we could make the queue cleaner take care of this—however, they could be treated as a separate case so that different retention period rules can be applied, etc.