Răsfoiți Sursa

循环中 .stop 停止

visuddhinanda 2 ani în urmă
părinte
comite
eae5ffcc26
1 a modificat fișierele cu 3 adăugiri și 0 ștergeri
  1. 3 0
      app/Console/Commands/UpgradeCompound.php

+ 3 - 0
app/Console/Commands/UpgradeCompound.php

@@ -125,6 +125,9 @@ class UpgradeCompound extends Command
 
 		$bar = $this->output->createProgressBar($count[0]->count);
 		foreach ($words as $key => $word) {
+            if(\App\Tools\Tools::isStop()){
+                return 0;
+            }
             $bar->advance();
 			if($this->option('continue')){
                 //先看目前字典里有没有已经拆过的这个词