From 3ef66628ad7688167319cfdc5b6ebea7dca837db Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 5 Dec 2022 03:28:31 -0700 Subject: [PATCH] Update StoryGC command --- app/Console/Commands/StoryGC.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Console/Commands/StoryGC.php b/app/Console/Commands/StoryGC.php index 1645ad88..8cd9b126 100644 --- a/app/Console/Commands/StoryGC.php +++ b/app/Console/Commands/StoryGC.php @@ -3,7 +3,6 @@ namespace App\Console\Commands; use Illuminate\Console\Command; -use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Storage; use App\Story; use App\StoryView; @@ -51,7 +50,7 @@ class StoryGC extends Command protected function archiveExpiredStories() { $stories = Story::whereActive(true) - ->where('created_at', '<', now()->subHours(24)) + ->where('expires_at', '<', now()) ->get(); foreach($stories as $story) { @@ -79,6 +78,7 @@ class StoryGC extends Command } StoryRotateMedia::dispatch($story)->onQueue('story'); StoryService::removeRotateQueue($id); + return; }); } }