45 lines
1.1 KiB
PHP
45 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Console;
|
|
|
|
use App\Jobs\QueuedCommand;
|
|
use Illuminate\Console\Scheduling\Schedule;
|
|
use Laravel\Lumen\Console\Kernel as ConsoleKernel;
|
|
|
|
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)
|
|
{
|
|
$logPath = storage_path('logs/artisan.log');
|
|
$schedule->command('real:sync-mongo')->cron('* * * * *')->withoutOverlapping()->appendOutputTo($logPath);
|
|
$schedule->command('virtual:sync-card')->cron('* * * * *')->withoutOverlapping()->appendOutputTo($logPath);
|
|
}
|
|
|
|
/**
|
|
* Queue the given console command.
|
|
*
|
|
* @param string $command
|
|
* @param array $parameters
|
|
* @return void
|
|
*/
|
|
public function queue($command, array $parameters = [])
|
|
{
|
|
dispatch(new QueuedCommand(func_get_args()));
|
|
}
|
|
}
|