37 lines
756 B
PHP
37 lines
756 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
|
||
|
|
namespace app\common\command;
|
||
|
|
|
||
|
|
|
||
|
|
use think\console\Command;
|
||
|
|
use think\console\Input;
|
||
|
|
use think\console\Output;
|
||
|
|
|
||
|
|
class AsyncPushMessage extends Command
|
||
|
|
{
|
||
|
|
protected function configure()
|
||
|
|
{
|
||
|
|
$this->setName('push-message')
|
||
|
|
->setDescription('消息推送'); //消息推送
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 清理过期装扮
|
||
|
|
* @param Input $input
|
||
|
|
* @param Output $output
|
||
|
|
* @return int|void|null
|
||
|
|
* @throws \think\Exception
|
||
|
|
* @throws \think\exception\PDOException
|
||
|
|
*/
|
||
|
|
protected function execute(Input $input, Output $output)
|
||
|
|
{
|
||
|
|
while (true) {
|
||
|
|
usleep(200000);
|
||
|
|
$reslut = model('api/AsyncPushMessage')->send_message();
|
||
|
|
// echo '监控成功!';
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}
|