Auto cleanup not working

Created on 14 October 2023, about 1 year ago
Updated 14 November 2023, about 1 year ago

Problem/Motivation

1. Implemented auto cleanup in the module cron hook does not work - it uses not defined module setting.
2. Code is not compatible with Drupal 10. ( https://www.drupal.org/node/3201242 β†’ )
3. Limit per cron is low(100), I would increase it to make it working with bigger traffic.

Steps to reproduce

1. Install module.
2. Create few rest logs.
3. Set module settings maximum lifetime to value which lead them to be removed.
4. Run cron.

Proposed resolution

1. Adjust the code to use `maximum_lifetime` setting.
2. Add `->accessCheck(FALSE)` to the entity query to make it compatible with Drupal 10.
3. Increase cleanup limit to make it working with bigger traffic.

πŸ› Bug report
Status

Fixed

Version

2.1

Component

Code

Created by

πŸ‡΅πŸ‡±Poland ad0z

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @ad0z
  • Issue was unassigned.
  • Status changed to Needs review about 1 year ago
  • πŸ‡΅πŸ‡±Poland ad0z

    I've pushed all needed changes to the related fork, review needed.

  • Status changed to Fixed about 1 year ago
  • πŸ‡ΊπŸ‡¦Ukraine zviryatko

    Many thanks for that one, also found that something went wrong with database size, but didn't have time to figure out πŸ˜…
    Checked, it works for me. Released!
    Maybe some time soon will have time to add tests...

  • Status changed to Needs review about 1 year ago
  • πŸ‡΅πŸ‡±Poland ad0z

    @zviryatko I am reopening this issue because I want you to commit the patch I am attaching in the next release if it's possible and you agree to changes I want to recommend.
    The patch is related with auto cleanup changes I made - I think loading and deleting every single entity is pretty bad idea in context of performance. I think we should put entities ids into chunks and then load and delete them.

  • @ad0z opened merge request.
  • Status changed to Fixed about 1 year ago
Production build 0.71.5 2024