-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Open
Labels
0. Needs triagePending check for reproducibility or if it fits our roadmapPending check for reproducibility or if it fits our roadmapenhancementfeature: previews and thumbnailsperformance 🚀🌍 scaling
Milestone
Description
With the new preview backend, we are deleting preview individually, this is probably expensive and slow.
server/lib/private/Preview/PreviewService.php
Lines 112 to 132 in b6e90ac
| public function deleteAll(): void { | |
| $lastId = 0; | |
| while (true) { | |
| $previews = $this->previewMapper->getPreviews($lastId, 1000); | |
| $i = 0; | |
| // FIXME: Should we use transaction here? Du to the I/O created when | |
| // deleting the previews from the storage, which might be on a network | |
| // This might take a non trivial amount of time where the DB is locked. | |
| foreach ($previews as $preview) { | |
| $this->deletePreview($preview); | |
| $i++; | |
| $lastId = $preview->getId(); | |
| } | |
| if ($i !== 1000) { | |
| break; | |
| } | |
| } | |
| } | |
Shouldn't we do it in one go?
- Flush the preview table
- Delete the preview directory
Previously it was done individually too.
Metadata
Metadata
Assignees
Labels
0. Needs triagePending check for reproducibility or if it fits our roadmapPending check for reproducibility or if it fits our roadmapenhancementfeature: previews and thumbnailsperformance 🚀🌍 scaling