Out of memory error whilst trying to cleanup old tweets

Created on 10 June 2021, over 3 years ago
Updated 12 February 2023, almost 2 years ago

Problem/Motivation

We recently updated get_tweets. Included in the update is https://www.drupal.org/node/2981605 β†’ which fixes the bug where old tweets weren't being cleaned up.

As a result, when cron now runs and calls GetTweetsBase::cleanup() the db query returns over 200,000 nodes, which it then tries to load all at once with $nodes = $storage->loadMultiple($result).

This causes a PHP out of memory error.

Proposed resolution

Add a limit to the db query, so a maximum of say 500 nodes are cleaned up at once.

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom nicrodgers Monmouthshire, UK

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

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