Вход Регистрация
Файл: vendor/laravel/framework/src/Illuminate/Console/Scheduling/SchedulePauseCommand.php
Строк: 51
<?php

namespace IlluminateConsoleScheduling;

use 
IlluminateConsoleCommand;
use 
IlluminateConsoleEventsSchedulePaused;
use 
IlluminateContractsCacheRepository as Cache;
use 
IlluminateContractsEventsDispatcher;
use 
SymfonyComponentConsoleAttributeAsCommand;

#[AsCommand(name: 'schedule:pause')]
class SchedulePauseCommand extends Command
{
    
/**
     * The console command description.
     *
     * @var string
     */
    
protected $description 'Pause the scheduler';

    
/**
     * Execute the console command.
     *
     * @return int
     */
    
public function handle(Cache $cacheDispatcher $dispatcher)
    {
        if (! 
Schedule::$pausable) {
            
$this->components->error('Schedule pausing is currently disabled.');

            return 
1;
        }

        
$cache->forever('illuminate:schedule:paused'true);

        
$dispatcher->dispatch(new SchedulePaused);

        
$this->components->info('Scheduled task processing has been paused.');

        return 
0;
    }
}
Онлайн: 2
Реклама