2024-05-07 12:17:25 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Console;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Console\Scheduling\Schedule;
|
|
|
|
|
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
2024-05-17 10:36:21 +02:00
|
|
|
use Illuminate\Support\Facades\Log;
|
2024-05-07 12:17:25 +02:00
|
|
|
|
|
|
|
|
class Kernel extends ConsoleKernel
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* The Artisan commands provided by your application.
|
|
|
|
|
*
|
|
|
|
|
* @var array
|
|
|
|
|
*/
|
|
|
|
|
protected $commands = [
|
2024-06-19 10:06:01 +02:00
|
|
|
//
|
2024-05-07 12:17:25 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Define the application's command schedule.
|
|
|
|
|
*
|
|
|
|
|
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
protected function schedule(Schedule $schedule)
|
|
|
|
|
{
|
2024-05-17 14:34:41 +02:00
|
|
|
|
2024-06-19 10:06:01 +02:00
|
|
|
Log::info('Controllo schedule...');
|
2024-05-07 12:17:25 +02:00
|
|
|
// $schedule->command('inspire')->hourly();
|
2024-06-15 18:29:22 +02:00
|
|
|
|
2024-05-17 10:36:21 +02:00
|
|
|
$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');
|
|
|
|
|
});
|
2024-05-17 14:34:41 +02:00
|
|
|
$schedule->command('product:startday')
|
|
|
|
|
->daily()->at('08:00')
|
2024-05-17 10:36:21 +02:00
|
|
|
->before(function () {
|
2024-05-17 14:34:41 +02:00
|
|
|
Log::info('Running product:startday command');
|
2024-05-17 10:36:21 +02:00
|
|
|
});
|
2024-06-18 18:00:06 +02:00
|
|
|
|
|
|
|
|
// 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');
|
|
|
|
|
});
|
2024-05-07 12:17:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Register the commands for the application.
|
|
|
|
|
*
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
protected function commands()
|
|
|
|
|
{
|
2024-05-17 10:36:21 +02:00
|
|
|
$this->load(__DIR__ . '/Commands');
|
2024-05-07 12:17:25 +02:00
|
|
|
|
|
|
|
|
require base_path('routes/console.php');
|
|
|
|
|
}
|
|
|
|
|
}
|