2022-08-12 07:56:56 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Console;
|
|
|
|
|
2022-09-08 16:12:02 +00:00
|
|
|
use App\Jobs\HostCost;
|
2022-09-03 05:22:40 +00:00
|
|
|
use App\Jobs\ClearTasks;
|
2022-09-03 06:01:51 +00:00
|
|
|
use App\Jobs\DeleteHost;
|
2022-11-06 11:28:22 +00:00
|
|
|
use App\Jobs\Remote\FetchModule;
|
|
|
|
use App\Jobs\Remote\PushWorkOrder;
|
|
|
|
use App\Jobs\CheckAndChargeBalance;
|
2022-08-12 07:56:56 +00:00
|
|
|
use Illuminate\Console\Scheduling\Schedule;
|
2022-11-06 11:28:22 +00:00
|
|
|
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
2022-08-12 07:56:56 +00:00
|
|
|
|
|
|
|
class Kernel extends ConsoleKernel
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Define the application's command schedule.
|
|
|
|
*
|
|
|
|
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
protected function schedule(Schedule $schedule)
|
|
|
|
{
|
2022-11-06 11:28:22 +00:00
|
|
|
$schedule->command('sanctum:prune-expired --hours=24')->daily();
|
|
|
|
|
2022-08-13 08:37:17 +00:00
|
|
|
// dispatch HostCost job
|
2022-09-10 03:20:44 +00:00
|
|
|
$schedule->job(new HostCost())->everyFiveMinutes();
|
2022-08-30 09:20:45 +00:00
|
|
|
// $schedule->job(new UserSave())->everyTenMinutes();
|
2022-11-06 11:28:22 +00:00
|
|
|
$schedule->job(new FetchModule())->withoutOverlapping()->everyMinute();
|
2022-09-06 15:38:56 +00:00
|
|
|
// $schedule->job(new Remote\PushHost())->everyMinute()->onOneServer();
|
2022-11-06 11:28:22 +00:00
|
|
|
$schedule->job(new PushWorkOrder())->everyMinute()->onOneServer();
|
2022-08-13 08:37:17 +00:00
|
|
|
|
2022-09-03 05:22:40 +00:00
|
|
|
$schedule->job(new ClearTasks())->weekly();
|
|
|
|
|
2022-09-03 06:01:51 +00:00
|
|
|
$schedule->job(new DeleteHost())->hourly();
|
2022-09-18 06:28:29 +00:00
|
|
|
|
2022-11-04 12:01:27 +00:00
|
|
|
$schedule->job(new CheckAndChargeBalance())->everyFiveMinutes()->onOneServer()->withoutOverlapping();
|
2022-11-06 11:28:22 +00:00
|
|
|
}
|
2022-09-21 05:35:09 +00:00
|
|
|
|
2022-11-06 11:28:22 +00:00
|
|
|
/**
|
|
|
|
* Register the commands for the application.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
protected function commands()
|
|
|
|
{
|
|
|
|
$this->load(__DIR__ . '/Commands');
|
2022-10-31 11:50:32 +00:00
|
|
|
|
2022-11-06 11:28:22 +00:00
|
|
|
require base_path('routes/console.php');
|
2022-08-12 07:56:56 +00:00
|
|
|
}
|
|
|
|
}
|