作者 lyh

gx

@@ -40,12 +40,8 @@ class UpdateProgress extends Command @@ -40,12 +40,8 @@ class UpdateProgress extends Command
40 */ 40 */
41 public function handle() 41 public function handle()
42 { 42 {
43 - while (true){  
44 - $project_id = Redis::rpop('updateProgress');  
45 - if(!$project_id){  
46 - sleep(2);  
47 - continue;  
48 - } 43 + $project_id = Redis::rpop('updateProgress');
  44 + while ($project_id){
49 echo date('Y-m-d H:i:s') . ' start: ' . $project_id . PHP_EOL; 45 echo date('Y-m-d H:i:s') . ' start: ' . $project_id . PHP_EOL;
50 try { 46 try {
51 ProjectServer::useProject($project_id); 47 ProjectServer::useProject($project_id);
@@ -36,6 +36,7 @@ class Kernel extends ConsoleKernel @@ -36,6 +36,7 @@ class Kernel extends ConsoleKernel
36 $schedule->command('inquiry_count')->dailyAt('01:00')->withoutOverlapping(1); // 询盘统计数据,每天凌晨执行一次 36 $schedule->command('inquiry_count')->dailyAt('01:00')->withoutOverlapping(1); // 询盘统计数据,每天凌晨执行一次
37 $schedule->command('domain_info')->dailyAt('01:00')->withoutOverlapping(1);// 更新域名|证书结束时间,每天凌晨1点执行一次 37 $schedule->command('domain_info')->dailyAt('01:00')->withoutOverlapping(1);// 更新域名|证书结束时间,每天凌晨1点执行一次
38 $schedule->command('last_inquiry')->dailyAt('04:00')->withoutOverlapping(1);// 最近一次询盘信息 38 $schedule->command('last_inquiry')->dailyAt('04:00')->withoutOverlapping(1);// 最近一次询盘信息
  39 + $schedule->command('update_progress')->everyThirtyMinutes()->withoutOverlapping(1);//监控更新
39 } 40 }
40 41
41 /** 42 /**