Files
apimacro/app/Console/Kernel.php
paoloar77 73bf0d22f3 schedule
2024-06-18 18:00:06 +02:00

74 lines
2.3 KiB
PHP

<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
use Illuminate\Support\Facades\Log;
class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
];
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
// Log::info('Controllo schedule...');
// $schedule->command('inspire')->hourly();
$schedule->command('backup:clean')->daily()->at('02:00')->before(function () {
Log::info('Running backup:clean command');
});
$schedule->command('backup:run')->daily()->at('07:00')->before(function () {
Log::info('Running backup:run command');
});
$schedule->command('order:gmupdate')->everyTenMinutes()->before(function () {
Log::info('Running order:gmupdate command');
});
$schedule->command('product:gmupdate')->daily()->at('02:00')->before(function () {
Log::info('Running product:gmupdate command');
});
$schedule->command('product:used:gmupdate')->daily()->at('04:30')->before(function () {
Log::info('Running product:used:gmupdate command');
});
$schedule->command('product:updateqta')->everyFiveMinutes()->between('8:00', '00:00')->withoutOverlapping()->before(function () {
Log::info('Running product:updateqta command');
});
$schedule->command('product:startday')
->daily()->at('08:00')
->before(function () {
Log::info('Running product:startday command');
});
// Pianifica l'esecuzione del comando ogni giorno a mezzanotte
$schedule->command('fix:storage-permissions')->daily()->at('00:30')->before(function () {
Log::info('Running fix:storage-permissions');
});
}
/**
* Register the commands for the application.
*
* @return void
*/
protected function commands()
{
$this->load(__DIR__ . '/Commands');
require base_path('routes/console.php');
}
}