Commit b5fb4a88 by Vladislav

remove clockworck cache in schedule

1 parent d2a9fc28
Showing with 10 additions and 0 deletions
......@@ -24,6 +24,7 @@ use App\Console\Commands\KeywordsDelete;
use App\Console\Commands\KeywordsUpdate;
use App\Console\Commands\RefreshLimits;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
......@@ -72,6 +73,15 @@ class Kernel extends ConsoleKernel
$schedule->command(AdvertisementsAdd::class)->hourlyAt(50);
$schedule->command(AdvertisementsUpdate::class)->hourlyAt(50);
$schedule->call(function () {
$items = new \FilesystemIterator(config('clockwork.storage_files_path'));
foreach ($items as $item) {
if ($item->getFilename() !== '.gitignore') {
echo @unlink($item->getPathname()) . PHP_EOL;
}
}
})->saturdays()->at('00:00');
}
/**
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!