2
0

UpgradeWeekly.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. $currTime = time();
  38. #译文进度
  39. $this->call('upgrade:progress');
  40. $time = time()-$currTime;
  41. $message = "progress time:{$time}; ";
  42. $this->info($message);
  43. $currTime = time();
  44. $this->call('upgrade:progress.chapter');
  45. $time = time()-$currTime;
  46. $message = "progress.chapter time:{$time}; ";
  47. $this->info($message);
  48. $currTime = time();
  49. # 逐词译数据库分析
  50. $this->call('upgrade:wbw.analyses');
  51. $time = time()-$currTime;
  52. $message = "wbw.analyses:{$time}; ";
  53. $this->info($message);
  54. # 段落更新图
  55. $this->call('upgrade:chapter.dynamic');
  56. $this->call('upgrade:chapter.dynamic.weekly');
  57. return 0;
  58. }
  59. }