diff --git a/.env.testing b/.env.testing index b2d2a727..60e02669 100644 --- a/.env.testing +++ b/.env.testing @@ -1,6 +1,6 @@ APP_NAME=Laravel APP_ENV=local -APP_KEY=base64:SrIyY45mJQvvP8DTufIDcTRptGHFka0jT+QCsAj1yI4= +APP_KEY=base64:Dau44h6D3cJyjYdcbJ2ZjEf52oKR5xqjQ4BrJykCh0g= APP_DEBUG=true APP_URL=http://localhost APP_DEMO=false diff --git a/src/App/Console/Kernel.php b/src/App/Console/Kernel.php index 69f08c15..ddd948f1 100644 --- a/src/App/Console/Kernel.php +++ b/src/App/Console/Kernel.php @@ -5,6 +5,7 @@ use Illuminate\Console\Scheduling\Schedule; use App\Console\Commands\SetupDevEnvironment; use App\Console\Commands\SetupProdEnvironment; use Support\Scheduler\Actions\ReportUsageAction; +use Support\Demo\Actions\DeleteAllSharedLinksAction; use Support\Scheduler\Actions\DeleteFailedFilesAction; use Illuminate\Foundation\Console\Kernel as ConsoleKernel; use Support\Scheduler\Actions\DeleteUnverifiedUsersAction; @@ -39,6 +40,12 @@ class Kernel extends ConsoleKernel )->everySixHours(); } + if (is_demo()) { + $schedule->call( + fn () => resolve(DeleteAllSharedLinksAction::class)() + )->daily()->at('00:00'); + } + $schedule->call( fn () => resolve(DeleteExpiredShareLinksAction::class)() )->everyTenMinutes(); diff --git a/src/Support/Demo/Actions/DeleteAllSharedLinksAction.php b/src/Support/Demo/Actions/DeleteAllSharedLinksAction.php new file mode 100644 index 00000000..389b516f --- /dev/null +++ b/src/Support/Demo/Actions/DeleteAllSharedLinksAction.php @@ -0,0 +1,12 @@ +delete(); + } +}