Kernel.php
3.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?php
namespace App\Console;
use App\Console\Commands\AdExtensionsLoad;
use App\Console\Commands\AdGroupsAdd;
use App\Console\Commands\AdGroupsLoadUpdated;
use App\Console\Commands\AdGroupsUpdate;
use App\Console\Commands\AdvertisementsAdd;
use App\Console\Commands\AdvertisementsLoadUpdated;
use App\Console\Commands\AdvertisementsUpdate;
use App\Console\Commands\CampaignsAdd;
use App\Console\Commands\CampaignsCheckChange;
use App\Console\Commands\CampaignsCheckUpdatedChildren;
use App\Console\Commands\CampaignsLoadGroups;
use App\Console\Commands\AdGroupsLoadKeywords;
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\DictionaryCampaignsSyncByCampaign;
use App\Console\Commands\KeywordsAdd;
use App\Console\Commands\KeywordsDelete;
use App\Console\Commands\KeywordsUpdate;
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(DictionaryCampaignsSyncByCampaign::class)->everyThirtyMinutes();
$schedule->command(RefreshLimits::class)->hourly();
$schedule->command(DictionariesLoad::class)->saturdays()->at('05:00');
$schedule->command(CampaignsCheckChange::class)->hourlyAt(5);
$schedule->command(CampaignsLoadUpdated::class)->hourlyAt(10);
$schedule->command(CampaignsCheckUpdatedChildren::class)->hourlyAt(10);
$schedule->command(CampaignsAdd::class)->hourlyAt(15);
$schedule->command(CampaignsUpdate::class)->hourlyAt(15);
$schedule->command(CampaignsResume::class)->hourlyAt(15);
$schedule->command(CampaignsSuspend::class)->hourlyAt(15);
$schedule->command(CampaignsLoadGroups::class)->hourlyAt(20);
$schedule->command(AdGroupsLoadUpdated::class)->hourlyAt(20);
$schedule->command(AdGroupsLoadKeywords::class)->hourlyAt(30);
$schedule->command(AdExtensionsLoad::class)->hourlyAt(25);
$schedule->command(AdGroupsAdd::class)->hourlyAt(30);
$schedule->command(AdGroupsUpdate::class)->hourlyAt(30);
$schedule->command(KeywordsAdd::class)->hourlyAt(40);
$schedule->command(KeywordsUpdate::class)->hourlyAt(40);
$schedule->command(KeywordsDelete::class)->hourlyAt(40);
$schedule->command(AdvertisementsLoadUpdated::class)->hourlyAt(40);
// $schedule->command(AdvertisementsAdd::class)->hourlyAt(50);
// $schedule->command(AdvertisementsUpdate::class)->hourlyAt(50);
$schedule->call(function () {
$items = new \FilesystemIterator(config('clockwork.storage_files_path'));
foreach ($items as $item) {
if ($item->getFilename() !== '.gitignore') {
echo @unlink($item->getPathname()) . PHP_EOL;
}
}
})->saturdays()->at('00:00');
}
/**
* Register the commands for the application.
*
* @return void
*/
protected function commands()
{
$this->load(__DIR__ . '/Commands');
require base_path('routes/console.php');
}
}