mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-22 04:53:17 +00:00
Merge pull request #3958 from pixelfed/staging
Update CloudMediaMigrate command
This commit is contained in:
commit
199c507974
1 changed files with 8 additions and 1 deletions
|
@ -7,6 +7,7 @@ use App\Media;
|
||||||
use App\Services\MediaStorageService;
|
use App\Services\MediaStorageService;
|
||||||
use App\Util\Lexer\PrettyNumber;
|
use App\Util\Lexer\PrettyNumber;
|
||||||
use Illuminate\Support\Facades\Storage;
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
use Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException;
|
||||||
|
|
||||||
class CloudMediaMigrate extends Command
|
class CloudMediaMigrate extends Command
|
||||||
{
|
{
|
||||||
|
@ -61,7 +62,13 @@ class CloudMediaMigrate extends Command
|
||||||
->each(function($media) use($bar) {
|
->each(function($media) use($bar) {
|
||||||
if(Storage::disk('local')->exists($media->media_path)) {
|
if(Storage::disk('local')->exists($media->media_path)) {
|
||||||
$this->totalSize = $this->totalSize + $media->size;
|
$this->totalSize = $this->totalSize + $media->size;
|
||||||
MediaStorageService::store($media);
|
try {
|
||||||
|
MediaStorageService::store($media);
|
||||||
|
} catch (FileNotFoundException $e) {
|
||||||
|
return;
|
||||||
|
} catch (Exception $e) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$bar->advance();
|
$bar->advance();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue