Skip to content
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

"clean" command works incorrectly #1107

Open
slaFFik opened this issue Oct 2, 2024 · 0 comments
Open

"clean" command works incorrectly #1107

slaFFik opened this issue Oct 2, 2024 · 0 comments
Labels
priority: normal The issue/PR is normal priority—not many people are affected or there’s a workaround, etc. type: bug The issue is a confirmed bug.

Comments

@slaFFik
Copy link
Contributor

slaFFik commented Oct 2, 2024

Here is the command I was using:

wp action-scheduler clean --before='31 days ago' --status=complete,failed,canceled

I did various tests, and it looks like:

  1. it does not correctly report the number of cleaned (removed) actions - it consistently shows a higher number than it actually removed (for example, on a small DB 88 actions were removed from the _actions table, while CLI reported 101; same with bigger DB).

  2. it does not remove actions that are satisfying the filtering criteria:
    After running the command above I still see actions that are older than 31 days, and they have a failed status. According to my command - they should be deleted.

  3. It does not remove all records of associated log entries from the _logs table.
    So I see log entries referencing action_id that was removed.
    I think the clean command should purge such records as well.

  4. Old claims are not deleted too.


There are no custom filters that modify AS behavior to affect the results above.

@coreymckrill coreymckrill added type: bug The issue is a confirmed bug. priority: normal The issue/PR is normal priority—not many people are affected or there’s a workaround, etc. labels Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: normal The issue/PR is normal priority—not many people are affected or there’s a workaround, etc. type: bug The issue is a confirmed bug.
Projects
None yet
Development

No branches or pull requests

2 participants