Install per-module schedule:run cron from artisan, store sms/in_app send minutes, and match scheduled triggers at exact HH:mm Tehran time. Co-authored-by: Cursor <cursoragent@cursor.com>
59 lines
2.0 KiB
PHP
59 lines
2.0 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
|
|
// یا یکبار: php artisan schedule:bootstrap
|
|
$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=14')
|
|
->hourly()
|
|
->name('pargar_requeue_wallet_docs_hourly')
|
|
->withoutOverlapping(50);
|
|
|
|
// یکبار در شبانهروز همهٔ مشتریان از ابتدای اتصال پرگار
|
|
$schedule->command('pargar:requeue-wallet-documents --execute --all')
|
|
->dailyAt('03:40')
|
|
->name('pargar_requeue_wallet_docs_all')
|
|
->withoutOverlapping(110);
|
|
|
|
$schedule->command('automations:run')
|
|
->everyMinute()
|
|
->name('automations_run')
|
|
->withoutOverlapping(50);
|
|
}
|
|
|
|
protected function commands()
|
|
{
|
|
$this->load(__DIR__.'/Commands');
|
|
|
|
require base_path('routes/console.php');
|
|
}
|
|
}
|