Use same config for user purge

This commit is contained in:
DariusIII
2025-06-06 15:15:57 +02:00
parent 50f5709159
commit 63949bbf80
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ class PurgeDeletedAccounts implements ShouldQueue
{
// Find users that were soft-deleted 6 months ago
User::onlyTrashed()
->where('deleted_at', '<', now()->subMonths(6))
->where('deleted_at', '<', now()->subDays(config('nntmux.purge_inactive_users_days')))
->get()
->each(function ($user) {
$user->forceDelete(); // Permanently delete the user
+2
View File
@@ -1,5 +1,6 @@
<?php
use App\Jobs\PurgeDeletedAccounts;
use App\Jobs\RemoveInactiveAccounts;
use Illuminate\Foundation\Inspiring;
use Illuminate\Support\Facades\Schedule;
@@ -32,4 +33,5 @@ Schedule::command('nntmux:collect-stats')->hourly();
Schedule::command('nntmux:populate-steam-apps')->monthly();
if (config('nntmux.purge_inactive_users') === true) {
Schedule::job(new RemoveInactiveAccounts)->daily();
Schedule::job(new PurgeDeletedAccounts)->daily();
}