-
Notifications
You must be signed in to change notification settings - Fork 216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
get_failed_rows date query should match the value of the rocket_remove_rucss_failed_jobs_cron_interval filter #6066
Comments
Added temporary manual failed jobs clearing + cache clearing until wp-media/wp-rocket#6066 is sorted out. Once done, using `rocket_remove_rucss_failed_jobs` will be enough.
Acceptance Criteria:
|
Reproduce the problemThe problem was easy to reproduce using instructions. Identify the root causeThe root cause is an hard-coded constant inside https://github.com/wp-media/wp-rocket/blob/develop/inc/Engine/Optimization/RUCSS/Database/Queries/UsedCSS.php#L423 which prevent us from changing the behavior. Scope a solutionFor that solution we could inspire from what was done to solve a similar issue on the preload: This is particularly good example as the implementation from this one created a discussion on how we should organize ourselves concerning magic constants inside query classes. First inside the Then the result need to be validated (cast to string, not empty and both parts existing) and then passed to the method public function get_failed_rows( float $delay = 3, string $unit = 'days') {
if ( ! self::$table_exists && ! $this->table_exists() ) {
return false;
}
$query = $this->query(
[
'status' => 'failed',
'date_query' => [
[
'column' => 'modified',
'before' => $delay $unit ago",
'inclusive' => true,
],
],
],
false
); Estimate the effortEffort |
looks good |
Reproduce the problemThe problem was easy to reproduce using instructions. Identify the root causeWe found out that changing failed jobs status to pending will not give them a new Job ID which means it is going to try to fetch the same failed data in this case Scope a solutionwe should send the URL again to saas to get a new jobId and change the status to pending so we can fetch the result for the saas new job in
we should use this function
Estimate the effortEffort |
Should we create a new method like |
Before submitting an issue please check that you’ve completed the following steps:
Yes - Made sure you’re on the latest version
Yes - Used the search feature to ensure that the bug hasn’t been reported before
Describe the bug
We can filter the
rocket_remove_rucss_failed_jobs_cron_interval
and set the recurrence of WP Rocket clear Remove Unused CSS failed jobs to 1 hour for example.This should allow to re-process the failed jobs faster.
But in the plugin code, the
get_failed_rows
function has the modified date query hardcoded to3 days ago
https://github.com/wp-media/wp-rocket/blob/develop/inc/Engine/Optimization/RUCSS/Database/Queries/UsedCSS.php#L423
The result is no failed row "younger" than 3 days wil be set to pending.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The
get_failed_rows
function should be aware of the value of therocket_remove_rucss_failed_jobs_cron_interval
filter so the query is dynamic and not static to "3 days ago".Additional context
Slack threads:
https://wp-media.slack.com/archives/C029G1B5HD2/p1690205678240629
https://wp-media.slack.com/archives/C08N8J6VC/p1690270849029839
Backlog Grooming (for WP Media dev team use only)
The text was updated successfully, but these errors were encountered: