Problem/Motivation

Schedules can be created at /admin/content/earkiv/schedules, with a name, an RRULE and an Active checkbox, and the module has a table that links schedules to archives. But nothing creates archive jobs from the schedules, so an active schedule does nothing. Regular archiving has to be set up outside the module, for example with a cron job that runs drush earkiv:create.

Proposed resolution

  • Every time drush earkiv:process runs, before it picks the next job, check the active schedules. If an occurrence of the RRULE has passed since the schedule was last checked, create a job with the default archiver and storage settings and link it to the schedule. Only one job is created per check, even if several occurrences have passed, for example after the server was down.
  • Use the time the schedule was created as the start of the rule when the RRULE has no DTSTART, so that a new schedule does not create a job for occurrences before it existed.
  • Store the time a schedule was last checked, so that each occurrence gives one job.
  • Skip a schedule while one of its jobs is new, running or waiting to be resumed, so that a slow crawl does not pile up jobs.
  • Show the next occurrence and the latest job of each schedule in the schedule list.
  • Describe in the README that the schedules are processed by earkiv:process, so how often cron or the system cron runs it decides how precise the schedules are.

Remaining tasks

  • Implement and test.
  • Review.

User interface changes

The schedule list shows the next occurrence and the latest job.

API changes

None.

Data model changes

The time a schedule was last checked is stored, as a new base field or in the State API.

AI-Generated: Yes (Used Claude Code to review the module and draft this issue.)

Issue fork earkiv-3636922

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

thomas alsén created an issue. See original summary.

thomas alsén’s picture

Status: Active » Fixed

Merged into 1.0.x!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.