mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 22:41:27 +00:00
Update StoryGC command
This commit is contained in:
parent
1692a95a98
commit
2a3fd8771d
1 changed files with 3 additions and 3 deletions
|
@ -54,7 +54,7 @@ class StoryGC extends Command
|
||||||
{
|
{
|
||||||
$day = now()->day;
|
$day = now()->day;
|
||||||
|
|
||||||
if($day !== 3) {
|
if($day != 3) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,12 +81,12 @@ class StoryGC extends Command
|
||||||
|
|
||||||
protected function deleteViews()
|
protected function deleteViews()
|
||||||
{
|
{
|
||||||
StoryView::where('created_at', '<', now()->subDays(2))->delete();
|
StoryView::where('created_at', '<', now()->subMinutes(1441))->delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function deleteStories()
|
protected function deleteStories()
|
||||||
{
|
{
|
||||||
$stories = Story::where('expires_at', '<', now())->take(50)->get();
|
$stories = Story::where('created_at', '<', now()->subMinutes(1441))->take(50)->get();
|
||||||
|
|
||||||
if($stories->count() == 0) {
|
if($stories->count() == 0) {
|
||||||
exit;
|
exit;
|
||||||
|
|
Loading…
Reference in a new issue