- 🇪🇨Ecuador jwilson3
Follow. Not only is cron affected, but also
drush feed-im
is affected. - First commit to issue fork.
- last update
over 1 year ago 703 pass - last update
over 1 year ago 703 pass - last update
over 1 year ago 716 pass - First commit to issue fork.
- 🇬🇧United Kingdom AndyF
Rebased against
ea64d3b8118d288d77e84f03e8cb1f70f45046f0
. - 🇳🇱Netherlands megachriz
Thanks for working on this!
I think that the Expire feature should be able to work without requiring an import. So it should get triggered on cron runs by itself. Do you think that makes sense? Is that doable without loading all feed types on each cron run?
- 🇬🇧United Kingdom AndyF
At the mo I've just rebased existing work and am currently taking a look through.
I've noticed what I think is a problem with the current approach: it locks the feed in the first item and unlocks it in the final item, but as they're cron queue worker items, they might not all get processed in a single run. So I think with sufficiently large workloads this would lead to feeds being locked between cron runs.
So it should get triggered on cron runs by itself. Do you think that makes sense?
Yup!
Is that doable without loading all feed types on each cron run?
It's been many years since I last looked at the codebase and I'm just getting acquainted with things so bear with me. IIUC we need to load the feed to get expired IDs, so the only way I can think of to avoid loading all the feeds on every run would be to add a new base field to track the last time it had a cron clear executed on it.
So a rough outline might be
- Add a new timestamp Feed base field eg.
cleared
and set it to 0 for existing feeds. - On cron
- we execute a query to find up to
entity_update_batch_size
feeds that haven't been cleared recently (as indicated bycleared
). For each of those feeds, if they have any expired IDs, we add the IDs to a per-feed expiration queue; - the feed expiration cron queue worker clears any items in its queue.
- we execute a query to find up to
- Add a new processor setting for how frequently to check for expired items?
Question: in an approach like this, do you think it's ok to only get a lock when grabbing the expired IDs? Ie actually deleting the items associated with those IDs will happen by processing a queue and the feed won't be locked by the queue workers?
Thanks!
- Add a new timestamp Feed base field eg.