Skip to content

Commit

Permalink
add filter for action scheduler retention period
Browse files Browse the repository at this point in the history
  • Loading branch information
circlecube committed Aug 14, 2024
1 parent 91021b0 commit 0af6828
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion includes/Performance.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,18 @@ function () {
);

add_action( 'after_mod_rewrite_rules', [ $this, 'onRewrite' ] );

add_filter( 'action_scheduler_retention_period', array( $this, 'nfd_asr_default' ) );
}

/**
* Update the default action scheduler retention period to 5 days instead of 30.
* The actions scheduler table tends to grow to gigantic sizes and this should help.
*
* @return int new retention period
*/
function nfd_asr_default() {
return 5 * DAY_IN_SECONDS;
}
/**
* When updating mod rewrite rules, also update our rewrites as appropriate.
*/
Expand Down

0 comments on commit 0af6828

Please sign in to comment.