NASER fix some issues
This commit is contained in:
Executable → Regular
+14
@@ -20,6 +20,20 @@ class Kernel extends ConsoleKernel
|
||||
protected function schedule(Schedule $schedule)
|
||||
{
|
||||
// $schedule->command('inspire')->hourly();
|
||||
$schedule->call(function () {
|
||||
// حلقه برای اجرای 6 بار در یک دقیقه (هر 10 ثانیه)
|
||||
for ($i = 0; $i < 6; $i++) {
|
||||
// \Illuminate\Support\Facades\Log::info("Update process ran at: " . now());
|
||||
|
||||
// فراخوانی کامند ما
|
||||
\Illuminate\Support\Facades\Artisan::call('product:update-status');
|
||||
|
||||
// 10 ثانیه صبر کن (به جز دور آخر که نیاز نیست اسکریپت باز بماند)
|
||||
if ($i < 5) {
|
||||
sleep(10);
|
||||
}
|
||||
}
|
||||
})->everyMinute()->name('update_products_every_20s')->withoutOverlapping();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user