Skip to content

Commit

Permalink
Remove replaced resource if possible
Browse files Browse the repository at this point in the history
  • Loading branch information
kdambekalns committed Feb 16, 2022
1 parent d010d42 commit 905bad7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Classes/Service/AssetUpdateService.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ private function replaceAsset(string $identifier): void
$this->logger->debug(sprintf('Did not replace resource on %s from %s, the local asset is an ImageVariant', $localAssetIdentifier, $identifier), LogEnvironment::fromMethodName(__METHOD__));
return;
}
// TODO do we need to delete the "old" resource? then we need to grab it here…
// $previousResource = $localAsset->getResource();
// we need to delete the "old" resource, so we grab it here…
$previousResource = $localAsset->getResource();

try {
$this->flushProxyForAsset($identifier);
Expand All @@ -162,8 +162,8 @@ private function replaceAsset(string $identifier): void
$assetResource->setFilename($proxy->getFilename());
$this->assetService->replaceAssetResource($localAsset, $assetResource);

// TODO … to delete it here!
// $this->resourceManager->deleteResource($previousResource);
// … to delete it here!
$this->resourceManager->deleteResource($previousResource);

$this->logger->debug(sprintf('Replaced resource on %s from %s', $localAssetIdentifier, $identifier), LogEnvironment::fromMethodName(__METHOD__));
}
Expand Down

0 comments on commit 905bad7

Please sign in to comment.