mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-22 01:22:16 +00:00
s3 bandwidth usage fix
This commit is contained in:
@@ -33,7 +33,7 @@ class Kernel extends ConsoleKernel
|
||||
*/
|
||||
protected function schedule(Schedule $schedule): void
|
||||
{
|
||||
if (! is_storage_driver('local')) {
|
||||
if (! isStorageDriver('local')) {
|
||||
$schedule->call(
|
||||
fn () => resolve(DeleteFailedFilesAction::class)()
|
||||
)->everySixHours();
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
namespace App\Users\Controllers;
|
||||
|
||||
use Illuminate\Http\Response;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Symfony\Component\HttpFoundation\StreamedResponse;
|
||||
use Illuminate\Contracts\Filesystem\FileNotFoundException;
|
||||
|
||||
class GetAvatarController
|
||||
{
|
||||
@@ -12,10 +12,10 @@ class GetAvatarController
|
||||
*/
|
||||
public function __invoke(
|
||||
string $basename
|
||||
): StreamedResponse | FileNotFoundException {
|
||||
): StreamedResponse | Response {
|
||||
// Check if file exist
|
||||
if (! Storage::exists("/avatars/$basename")) {
|
||||
abort(404);
|
||||
return response('File not found', 404);
|
||||
}
|
||||
|
||||
// Return avatar
|
||||
|
||||
@@ -42,7 +42,7 @@ class UserSetting extends Model
|
||||
$link = [];
|
||||
|
||||
// Get avatar from external storage
|
||||
if ($this->attributes['avatar'] && ! is_storage_driver('local')) {
|
||||
if ($this->attributes['avatar'] && ! isStorageDriver('local')) {
|
||||
foreach (config('vuefilemanager.avatar_sizes') as $item) {
|
||||
$filePath = "avatars/{$item['name']}-{$this->attributes['avatar']}";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user