12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- namespace app\admin\command;
- use app\task\Kernel;
- use think\console\Command;
- use think\console\Input;
- use think\console\Output;
- class TimedTask extends Command
- {
- protected function configure()
- {
- $this->setName('TimedTask')->setDescription('Here is the remark ');
- }
-
- protected function execute(Input $input, Output $output)
- {
- $output->writeln("TimedTaskCommand:");
- while (true){
- $start_time = time();
-
- if (($start_time % 60) === 0){
-
- (new Kernel())->schedule();
- }
- sleep(1);
- }
- }
- }
|