Files
boursecu_server/app/Console/Kernel.php
T
2026-08-01 14:04:01 +03:30

47 lines
1.5 KiB
PHP

<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
protected $commands = [
Commands\Price::class,
];
protected function schedule(Schedule $schedule)
{
// تیک قیمت — ۶ بار در دقیقه با فاصله ۱۰ ثانیه (montzar + zaarbox + محصولات)
// نیاز: * * * * * php artisan schedule:run
$schedule->command('prices:tick-loop --iterations=6 --interval=10')
->everyMinute()
->name('prices_tick_10s')
->withoutOverlapping(58);
$schedule->command('prices:refresh-zaarbox')
->everyThirtyMinutes()
->name('refresh_zaarbox_prices')
->withoutOverlapping();
// پاک‌سازی و downsample تاریخچه — ساعت ۱۲ شب
$schedule->command('prices:prune')
->dailyAt('00:00')
->name('prune_price_snapshots');
// ترمیم اسناد ریالی جاافتادهٔ پرگار (واریز/برداشت بدون لاگ) تا مانده قفل نماند
$schedule->command('pargar:requeue-wallet-documents --execute --days=120')
->hourly()
->name('pargar_requeue_wallet_docs')
->withoutOverlapping(50);
}
protected function commands()
{
$this->load(__DIR__.'/Commands');
require base_path('routes/console.php');
}
}