فهرست منبع

增加任务开始和结束输出

visuddhinanda 3 سال پیش
والد
کامیت
7f4214ab83

+ 16 - 5
app/Console/Commands/UpgradeChapterDynamic.php

@@ -42,15 +42,18 @@ class UpgradeChapterDynamic extends Command
      */
     public function handle()
     {
-        $start = time();
+		$this->info('upgrade:chapterdynamic start.');
+
+        $startAt = time();
         $img_width = 600;
         $img_height = 120;
         $days = 300; //统计多少天
         $min = 30;
         $linewidth = 2;
 
-        $this->info('更新总动态');
+        
 //更新总动态
+		$this->info("更新总动态");
         $chapters = ProgressChapter::select('book','para')
                                     ->groupBy('book','para')
                                     ->orderBy('book')
@@ -91,8 +94,10 @@ class UpgradeChapterDynamic extends Command
         }
         $bar->finish();
 
-        $this->info('用时'.(time()-$start));
-        $start = time();
+		$time = time()- $startAt;
+        $this->info("用时 {$time}");
+
+        $startAt = time();
 
         $this->info('更新缺的章节空白图');
         // 更新缺的章节空白图
@@ -113,8 +118,10 @@ class UpgradeChapterDynamic extends Command
             }
         }
         $bar->finish();
+		$time = time()- $startAt;
+        $this->info("用时 {$time}");
 
-
+		$startAt = time();
         //更新chennel动态
         $this->info('更新chennel动态');
         $bar = $this->output->createProgressBar(ProgressChapter::count());
@@ -153,6 +160,10 @@ class UpgradeChapterDynamic extends Command
             }
         }
         $bar->finish();
+		$time = time()- $startAt;
+        $this->info("用时 {$time}");
+
+        $this->info("upgrade:chapterdynamic done");
 
         return 0;
     }

+ 1 - 1
app/Console/Commands/UpgradeDaily.php

@@ -50,7 +50,7 @@ class UpgradeDaily extends Command
 		}
 
         # 刷巴利语句子uuid 仅调用一次
-        $this->call('upgrade:palitextid');
+        //$this->call('upgrade:palitextid');
         //巴利原文段落库目录结构改变时运行
         $this->call('upgrade:palitext'); 
         #巴利段落标签

+ 5 - 1
app/Console/Commands/UpgradeProgress.php

@@ -42,7 +42,8 @@ class UpgradeProgress extends Command
      */
     public function handle()
     {
-
+		$this->info('upgrade:progress start');
+		$startTime = time();
 
         $channels = Sentence::where('strlen','>',0)
                           ->where('book_id','<',1000)
@@ -102,6 +103,9 @@ class UpgradeProgress extends Command
         }
         $bar->finish();
 
+		$time = time() - $startTime;
+		$this->info("upgrade progress finished in {$time}s");
+
         return 0;
     }
 }

+ 5 - 1
app/Console/Commands/UpgradeProgressChapter.php

@@ -46,6 +46,9 @@ class UpgradeProgressChapter extends Command
      */
     public function handle()
     {
+		$this->info("upgrade:progresschapter start.");
+		$startTime = time();
+
         $tagCount=0;
         #第一步 查询有多少书有译文
 		$books = Sentence::where('strlen','>',0)
@@ -199,7 +202,8 @@ class UpgradeProgressChapter extends Command
             $bar->advance();
         }
         $bar->finish();
-        $this->info("tag count:".$tagCount);
+		$time = time() - $startTime;
+		$this->info("upgrade:progresschapter finished in {$time}s tag count:{$tagCount}");
         return 0;
     }
 }

+ 5 - 1
app/Console/Commands/UpgradeWbwAnalyses.php

@@ -40,6 +40,9 @@ class UpgradeWbwAnalyses extends Command
      */
     public function handle()
     {
+		$startAt = time();
+		$this->info("upgrade:wbwanalyses start");
+
         $bar = $this->output->createProgressBar(Wbw::count());
         $counter =0;
         if(empty($this->argument('id'))){
@@ -140,7 +143,8 @@ class UpgradeWbwAnalyses extends Command
             $bar->advance();
         }
         $bar->finish();
-        $this->info("wbw analyses finished");
+		$time = time() - $startAt;
+        $this->info("wbw analyses done in {$time}");
         return 0;
     }
 }