forked from mirror/pixelfed
Update StoryGC command
This commit is contained in:
parent
6e16158afc
commit
3ef66628ad
1 changed files with 2 additions and 2 deletions
|
@ -3,7 +3,6 @@
|
||||||
namespace App\Console\Commands;
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
use Illuminate\Support\Facades\DB;
|
|
||||||
use Illuminate\Support\Facades\Storage;
|
use Illuminate\Support\Facades\Storage;
|
||||||
use App\Story;
|
use App\Story;
|
||||||
use App\StoryView;
|
use App\StoryView;
|
||||||
|
@ -51,7 +50,7 @@ class StoryGC extends Command
|
||||||
protected function archiveExpiredStories()
|
protected function archiveExpiredStories()
|
||||||
{
|
{
|
||||||
$stories = Story::whereActive(true)
|
$stories = Story::whereActive(true)
|
||||||
->where('created_at', '<', now()->subHours(24))
|
->where('expires_at', '<', now())
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
foreach($stories as $story) {
|
foreach($stories as $story) {
|
||||||
|
@ -79,6 +78,7 @@ class StoryGC extends Command
|
||||||
}
|
}
|
||||||
StoryRotateMedia::dispatch($story)->onQueue('story');
|
StoryRotateMedia::dispatch($story)->onQueue('story');
|
||||||
StoryService::removeRotateQueue($id);
|
StoryService::removeRotateQueue($id);
|
||||||
|
return;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue