runOnePending(); }); } /** * 执行一条待完成的测试记录(status=0) */ private function runOnePending(): void { $record = DiceRewardConfigRecord::where('status', DiceRewardConfigRecord::STATUS_RUNNING) ->order('id') ->find(); if (!$record) { return; } $recordId = (int) $record->id; try { (new WeightTestRunner())->run($recordId); } catch (\Throwable $e) { // WeightTestRunner 内部会更新 status=-1 和 remark } } }