Stage directories should be deleted in the background, during cron runs

Created on 5 June 2023, about 1 year ago
Updated 17 October 2023, 8 months ago

Problem/Motivation

Right now, when a stage is destroyed, it is completely deleted right then and there. That takes a little bit of time, which might be better spent doing other things.

This also would speed thing up from the users perspective because now in Automatic Update forms and Project Browser the operation is not complete until we delete the directory. So we are making the user wait for this when they really don't need to.

Proposed resolution

The StageBase::destroy() method should mark a directory for deletion, and Package Manager should clean it up during cron later. Any files that cannot be deleted should just be ignored, on the assumption that the operating system will do that clean-up on its own.

We could mark the stage directory for deletion by adding it to a queue, and letting cron handle it on its own.

API changes

StageBase::__construct() will need Drupal\Core\Queue\QueueFactory where it currently takes FileSystemInterface. So this is a breaking change for anything that extends StageBase (hello, Project Browser!)

Feature request
Status

Fixed

Version

3.0

Component

Package Manager

Created by

🇺🇸United States phenaproxima Massachusetts

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

Comments & Activities

Production build 0.69.0 2024