action-scheduler icon indicating copy to clipboard operation
action-scheduler copied to clipboard

Add method for purging failed actions

Open rrennick opened this issue 5 years ago • 4 comments
trafficstars

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.

rrennick avatar Jan 13 '20 20:01 rrennick

add a user intervention

@rrennick Were you thinking this would be an interface or setting, or a filter or constant?

crstauf avatar Mar 31 '20 18:03 crstauf

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.

rrennick avatar Apr 01 '20 13:04 rrennick

+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!

Surbma avatar Feb 23 '21 08:02 Surbma

+1! Or a wp CLI action that cleans up all completed/failed/cancelled actions. Also very useful in development.

strarsis avatar Jun 07 '22 00:06 strarsis

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.

barryhughes avatar Dec 21 '22 22:12 barryhughes