mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-10-30 23:52:40 +01:00
Reduced calls for s3-based uploads
Combined the public ACL update into the put operation.
This commit is contained in:
parent
140aed3586
commit
f8cdd6e80d
@ -106,8 +106,7 @@ class ImageService
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$storage->put($fullPath, $imageData);
|
$storage->put($fullPath, $imageData, ['visibility' => 'public']);
|
||||||
$storage->setVisibility($fullPath, 'public');
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
\Log::error('Error when attempting image upload:' . $e->getMessage());
|
\Log::error('Error when attempting image upload:' . $e->getMessage());
|
||||||
throw new ImageUploadException(trans('errors.path_not_writable', ['filePath' => $fullPath]));
|
throw new ImageUploadException(trans('errors.path_not_writable', ['filePath' => $fullPath]));
|
||||||
@ -191,8 +190,7 @@ class ImageService
|
|||||||
|
|
||||||
$thumbData = $this->resizeImage($storage->get($imagePath), $width, $height, $keepRatio);
|
$thumbData = $this->resizeImage($storage->get($imagePath), $width, $height, $keepRatio);
|
||||||
|
|
||||||
$storage->put($thumbFilePath, $thumbData);
|
$storage->put($thumbFilePath, $thumbData, ['visibility' => 'public']);
|
||||||
$storage->setVisibility($thumbFilePath, 'public');
|
|
||||||
$this->cache->put('images-' . $image->id . '-' . $thumbFilePath, $thumbFilePath, 60 * 60 * 72);
|
$this->cache->put('images-' . $image->id . '-' . $thumbFilePath, $thumbFilePath, 60 * 60 * 72);
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user