vd/app/Console/Kernel.php
2019-01-24 16:39:27 +08:00

47 lines
1.2 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);
// $schedule->command('virtual:sync-log')->cron('* * 1 * *')->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()));
}
}