[feeds_log] Make number of logged import entries to purge configurable

Created on 8 February 2024, 5 months ago
Updated 10 May 2024, about 2 months ago

Problem/Motivation

I'd like to be able to configure the number of logged import entries that are purged per cron run. We are very heavily using feeds to aggregate all kinds of stuff and the currently hard-coded limit of 100 items per cron run is not enough to keep the feeds_import_log_entry database table at a somewhat reasonable size (does not keep up with the amount of entries being added).

Steps to reproduce

Run cron.

Proposed resolution

See attached patch.

Remaining tasks

Discuss.

User interface changes

Yes, new field on Feeds log settings form on /admin/config/content/feeds_log

API changes

No.

Data model changes

feeds_log settings configuration schema is affected.

✨ Feature request
Status

Needs work

Version

3.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany jan.stoeckler

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

Comments & Activities

  • Issue created by @jan.stoeckler
  • Status changed to Needs review 5 months ago
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.5 + Environment: PHP 7.4 & MySQL 5.7
    last update 5 months ago
    716 pass
  • πŸ‡©πŸ‡ͺGermany jan.stoeckler

    Interested in thought, feedback, anything :-)

  • πŸ‡³πŸ‡±Netherlands MegaChriz

    Oh, wow. I hadn't imagined that more than 100 items would be imported on each cron run on average. I think it is a good idea to add a setting for this.

    I do wonder if in feeds_log_cron() we should log how many items were removed from the log. That could potentially spam other logs. I see that dblog_cron() doesn't do this when cleaning up log entries.
    At least I think that the \Drupal::messenger() bit could be removed. Or what is the reason that you added that?

  • Status changed to Needs work about 2 months ago
  • πŸ‡―πŸ‡΅Japan ptmkenny

    Setting to "Needs work" because of the comment in #3:

    At least I think that the \Drupal::messenger() bit could be removed. Or what is the reason that you added that?

Production build 0.69.0 2024