From 5b55165acd706be2b436d07bb3fce59055bc9c1f Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 10 Jun 2019 22:08:40 -0600 Subject: [PATCH] Update RemoteFollow job --- app/Jobs/RemoteFollowPipeline/RemoteFollowImportRecent.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Jobs/RemoteFollowPipeline/RemoteFollowImportRecent.php b/app/Jobs/RemoteFollowPipeline/RemoteFollowImportRecent.php index db70b24b2..5b413ecc1 100644 --- a/app/Jobs/RemoteFollowPipeline/RemoteFollowImportRecent.php +++ b/app/Jobs/RemoteFollowPipeline/RemoteFollowImportRecent.php @@ -56,7 +56,7 @@ class RemoteFollowImportRecent implements ShouldQueue */ public function handle() { - $outbox = $this->fetchOutbox(); + // $outbox = $this->fetchOutbox(); } public function fetchOutbox($url = false) @@ -216,7 +216,7 @@ class RemoteFollowImportRecent implements ShouldQueue $info = pathinfo($url); $url = str_replace(' ', '%20', $url); $img = file_get_contents($url); - $file = '/tmp/'.str_random(12).$info['basename']; + $file = '/tmp/'.str_random(64); file_put_contents($file, $img); $path = Storage::putFile($storagePath, new File($file), 'public'); @@ -230,6 +230,8 @@ class RemoteFollowImportRecent implements ShouldQueue $media->save(); ImageThumbnail::dispatch($media); + + @unlink($file); return true; } catch (Exception $e) {