Kernel.php 2.2 KB
<?php

namespace App\Console;

use App\Console\Commands\AdGroupsAdd;
use App\Console\Commands\AdGroupsLoadUpdated;
use App\Console\Commands\AdGroupsUpdate;
use App\Console\Commands\CampaignsAdd;
use App\Console\Commands\CampaignsCheckChange;
use App\Console\Commands\CampaignsCheckUpdatedChildrenAdGroups;
use App\Console\Commands\CampaignsLoadGroups;
use App\Console\Commands\CampaignsResume;
use App\Console\Commands\CampaignsSuspend;
use App\Console\Commands\CampaignsUpdate;
use App\Console\Commands\DictionariesLoad;
use App\Console\Commands\CampaignsLoadUpdated;
use App\Console\Commands\RefreshLimits;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\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)
    {
        $schedule->command(RefreshLimits::class)->hourly();
        $schedule->command(DictionariesLoad::class)->saturdays()->at('05:00');
        $schedule->command(CampaignsCheckChange::class)->hourlyAt(5);
        $schedule->command(CampaignsCheckUpdatedChildrenAdGroups::class)->hourlyAt(10);
        $schedule->command(CampaignsLoadUpdated::class)->hourlyAt(10);

        $schedule->command(CampaignsAdd::class)->hourlyAt(20);
        $schedule->command(CampaignsUpdate::class)->hourlyAt(20);
        $schedule->command(CampaignsResume::class)->hourlyAt(20);
        $schedule->command(CampaignsSuspend::class)->hourlyAt(20);
        $schedule->command(AdGroupsLoadUpdated::class)->hourlyAt(20);

//        $schedule->command(CampaignsLoadGroups::class)->hourlyAt(40);
        $schedule->command(AdGroupsAdd::class)->hourlyAt(30);
        $schedule->command(AdGroupsUpdate::class)->hourlyAt(30);
    }

    /**
     * Register the commands for the application.
     *
     * @return void
     */
    protected function commands()
    {
        $this->load(__DIR__ . '/Commands');

        require base_path('routes/console.php');
    }
}