Allow usage records to be registered in background

Created on 21 November 2018, about 6 years ago
Updated 9 February 2024, 11 months ago

Problem/Motivation

We currently have some content types (containing lots of fields/paragraphs) that take a lot of time to save. In some cases over 30 seconds. A big part of this is caused by the recursive entity tracking and scanning a lot of fields.

Proposed resolution

Since we do not have any automatic jobs running based on entity usage information, it is ok if the entity usage information is a little bit out of date to improve the performance. The idea was to allow the entity usage tracking to be built via a queue on cron runs. We are then making sure cron runs every 5 or 10 minutes, do the information would never be out of date too much.

Remaining tasks

  • Add a setting 'Update entity usage information via a queue', turned off by default
  • Make sure we add a proper warning/disclaimer explaining this means entity usage information is always going to be out of date, and should only be enabled when the entity usage information is not being used to automatically update or delete content.
  • Make the update hooks write entity IDs and the operation to the queue if the setting is enabled.
  • Make the queue handle the tracking as usual based on the operation.

User interface changes

New checkbox in settings page.

API changes

Data model changes

Feature request
Status

Needs review

Version

2.0

Component

Code

Created by

🇳🇱Netherlands seanB Netherlands

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024