Files
boursecu_server/app/Console/Kernel.php
T

53 lines
1.8 KiB
PHP
Raw Normal View History

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