Install
Works with Drupal: ^11.1Using Composer to manage Drupal site dependencies
Alternative installation files
Download tar.gz
397.41 KB
MD5: 7b15bd97d987437a20ee1a87b29e17d6
SHA-1: 9aa48464a1f5d2e58053f50595a5aa793aad8106
SHA-256: 2b3d9b22f0166085078114feac8011f29eec74e8ccc5184e12a16b77544edb54
Download zip
632.82 KB
MD5: d4c85fcee97b41378a54e863cd7aa117
SHA-1: aa1d14980c4fa41ba2740bbdba376f5e36f0b170
SHA-256: ceca0f02a96424264bb24a0588e8deb5b81d2832c7429ce4c46d40ecc23f4f0d
Release notes
This release makes the tracking of existing entities scale with the bundle instead of against it. Nothing changes for site builders or plugin authors; the behaviour is the same, the cost is not. Run drush updb is not needed – there are no update hooks – but note the API changes below if you call the backfill service yourself.
Added
- A time budget for cron. Cron used to evaluate one batch of pending tracking rows per run (
cron_limit, 50 by default), however large the backlog. It now makes as many passes of that size as the new settingcron_time_budgetallows (30 seconds by default, on the settings form) and stops early when a pass brings back only rows a previous one already handled. A backlog a migration or a catch-up created is worked off in one or two cron runs instead of hundreds. drush cn:track-existing --time-limit=<seconds>. A run by hand stops starting pages once the limit has passed and hands the rest to the queue, which finishes it on cron.
<
Changed
- Memory stays flat. Every page of a backfill run frees the entities it loaded and whatever resolving their scopes pulled into the memory cache. A run by hand over a large bundle no longer grows with it.
- One walk per trigger pair. Templates firing on the same entity type and bundle share one run: every entity is loaded and its scope resolved once, then offered to each template. A template scheduled while a run for its pair is queued or running joins that run instead of starting another. Ten templates on events cost one pass over the events, not ten.
- Unchanged rules, incremental run. Each completed run stores per template a fingerprint of everything that decides what waits – trigger, conditions, maximum lateness, and the scope, lateness and conditions of its active overrides – together with the run's start time, highest entity ID and cutoff. A later run over the same fingerprint, with a cutoff no earlier than before, loads only what the last run cannot have judged: entities with a higher ID, entities changed since, and entities that already carry a tracking row. Reactivating a template, enabling a bundle again or editing a template's text therefore no longer walks the whole bundle. A pair that a scope provider or a scope resolution claims always runs in full, because a scope entity can change without the triggering entity noticing. The log line of a completed run says which mode it ran in.
API changes
TrackingBackfill::page()andenqueue()are replaced bypageRun()andenqueueRun()over the newBackfillRunvalue object;run()takes an optional deadline and page size;logCompletion()takes the run's baseline. The queue item and the tracking tab's batch carry a run.NotificationDispatcher::processPending()returns the keys of the rows it processed.TrackingBackfilltakes the scope resolver, the entity field manager, the entity memory cache, state, the key-value factory and the time service as new constructor arguments;CronHookstakes the time service.
Full details in CHANGELOG.md.