UpgradeWeekly.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. namespace App\Console\Commands;
  3. use Illuminate\Console\Command;
  4. class UpgradeWeekly extends Command
  5. {
  6. /**
  7. * The name and signature of the console command.
  8. *
  9. * @var string
  10. */
  11. protected $signature = 'upgrade:weekly';
  12. /**
  13. * The console command description.
  14. *
  15. * @var string
  16. */
  17. protected $description = '周更';
  18. /**
  19. * Create a new command instance.
  20. *
  21. * @return void
  22. */
  23. public function __construct()
  24. {
  25. parent::__construct();
  26. }
  27. /**
  28. * Execute the console command.
  29. *
  30. * @return int
  31. */
  32. public function handle()
  33. {
  34. if(\App\Tools\Tools::isStop()){
  35. return 0;
  36. }
  37. #译文进度
  38. $this->call('upgrade:progress');
  39. $time = time()-$currTime;
  40. $message .= "progress:{$time}; ";
  41. $currTime = time();
  42. $this->call('upgrade:progress.chapter');
  43. $time = time()-$currTime;
  44. $message .= "progress.chapter:{$time}; ";
  45. $currTime = time();
  46. # 逐词译数据库分析
  47. $this->call('upgrade:wbw.analyses');
  48. $time = time()-$currTime;
  49. $message .= "wbw.analyses:{$time}; ";
  50. # 段落更新图
  51. $this->call('upgrade:chapter.dynamic');
  52. $this->call('upgrade:chapter.dynamic.weekly');
  53. return 0;
  54. }
  55. }