Files
apimacro/app/Console/Kernel.php

77 lines
2.4 KiB
PHP
Raw Normal View History

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-08-14 17:34:05 +02:00
Commands\CheckProductBySku::class,
2024-08-14 15:43:49 +00:00
Commands\GetFirstOrder::class,
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:10:19 +02:00
// Log::info('Controllo schedule...');
2024-05-07 12:17:25 +02:00
// $schedule->command('inspire')->hourly();
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');
});
2024-09-27 18:29:51 +02:00
$schedule->command('order:gmupdate')->everyTwoHours()->before(function () {
Log::info('Running order:gmupdate command');
});
2024-05-17 10:36:21 +02:00
$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-07-18 17:10:55 +02:00
/*$schedule->command('product:startday')
2024-05-17 14:34:41 +02:00
->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-07-18 17:10:55 +02:00
2024-06-18 18:00:06 +02:00
// Pianifica l'esecuzione del comando ogni giorno a mezzanotte
2024-06-19 16:40:36 +02:00
$schedule->command('fix:storage-permissions')->everyFiveMinutes()->before(function () {
2024-06-18 18:00:06 +02:00
Log::info('Running fix:storage-permissions');
});
2024-07-18 17:10:55 +02:00
*/
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');
}
}