Completed
Push — master ( 4f00d5...2afce4 )
by John
29s queued 13s
created

Kernel::schedule()   A

Complexity

Conditions 5
Paths 4

Size

Total Lines 23
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 6
Bugs 0 Features 5
Metric Value
cc 5
eloc 11
c 6
b 0
f 5
nc 4
nop 1
dl 0
loc 23
rs 9.6111
1
<?php
2
3
namespace App\Console;
4
5
use Illuminate\Console\Scheduling\Schedule;
6
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
7
8
class Kernel extends ConsoleKernel
9
{
10
    /**
11
     * The Artisan commands provided by your application.
12
     *
13
     * @var array
14
     */
15
    protected $commands=[
16
        //
17
    ];
18
19
    /**
20
     * Define the application's command schedule.
21
     *
22
     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
23
     * @return void
24
     */
25
    protected function schedule(Schedule $schedule)
26
    {
27
28
        $schedule->command('scheduling:updateSiteRank')->dailyAt('01:00')->description("Update Rank");
29
30
        $schedule->command('scheduling:updateSiteMap')->dailyAt('02:00')->description("Update SiteMap");
31
32
        $schedule->command('scheduling:updateTrendingGroups')->dailyAt('03:00')->description("Update Trending Groups");
33
34
        $schedule->command('scheduling:updateGroupElo')->dailyAt('04:00')->description("Update Group Elo");
35
36
        $schedule->command('scheduling:syncRankClarification')->everyMinute()->description("Sync Remote Contest Rank and Clarification");
37
38
        $schedule->command('scheduling:syncContestProblem')->everyMinute()->description("Sync Remote Contest Problem");
39
40
        $schedule->command('scheduling:updateJudgeServerStatus')->everyMinute()->description("Update Judge Server Status");
41
42
        if (!config("app.debug") && config("app.backup")) {
43
            $schedule->command('backup:run')->weekly()->description("BackUp Site");
44
        }
45
46
        if (!config("app.debug") && config("app.backup")) {
47
            $schedule->command('backup:run --only-db')->dailyAt('00:30')->description("BackUp DataBase");
48
        }
49
    }
50
51
    /**
52
     * Register the commands for the application.
53
     *
54
     * @return void
55
     */
56
    protected function commands()
57
    {
58
        $this->load(__DIR__.'/Commands');
59
60
        require base_path('routes/console.php');
61
    }
62
}
63