Merge branch 'master' of http://47.244.231.31:8099/zhl/globalso-v6
正在显示
1 个修改的文件
包含
9 行增加
和
7 行删除
| @@ -10,10 +10,8 @@ | @@ -10,10 +10,8 @@ | ||
| 10 | namespace App\Console\Commands\Update; | 10 | namespace App\Console\Commands\Update; |
| 11 | 11 | ||
| 12 | use App\Models\Log\OperationHeartbeat; | 12 | use App\Models\Log\OperationHeartbeat; |
| 13 | -use App\Models\Project\Project; | ||
| 14 | -use App\Services\ProjectServer; | ||
| 15 | use Illuminate\Console\Command; | 13 | use Illuminate\Console\Command; |
| 16 | -use Illuminate\Support\Facades\DB; | 14 | + |
| 17 | 15 | ||
| 18 | class UpdateHeartbeat extends Command | 16 | class UpdateHeartbeat extends Command |
| 19 | { | 17 | { |
| @@ -40,9 +38,13 @@ class UpdateHeartbeat extends Command | @@ -40,9 +38,13 @@ class UpdateHeartbeat extends Command | ||
| 40 | * @time :2024/8/28 15:25 | 38 | * @time :2024/8/28 15:25 |
| 41 | */ | 39 | */ |
| 42 | public function handle(){ | 40 | public function handle(){ |
| 43 | - $date = date('Y-m-d H:i:s',time() - 30 * 60); | ||
| 44 | - $operationHeartbeatModel = new OperationHeartbeat(); | ||
| 45 | - $operationHeartbeatModel->edit(['status'=>0],['updated_at'=>['<=',$date]]); | ||
| 46 | - echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; | 41 | + while (true){ |
| 42 | + $date = date('Y-m-d H:i:s',time() - 10 * 60); | ||
| 43 | + $operationHeartbeatModel = new OperationHeartbeat(); | ||
| 44 | + $operationHeartbeatModel->edit(['status'=>0],['updated_at'=>['<=',$date]]); | ||
| 45 | + echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; | ||
| 46 | + sleep(10); | ||
| 47 | + return true; | ||
| 48 | + } | ||
| 47 | } | 49 | } |
| 48 | } | 50 | } |
-
请 注册 或 登录 后发表评论