| 68 | } |
| 69 | |
| 70 | void KeepMasterThread::DoRun() { |
| 71 | impl_->scheduler->OnKeepMasterThreadRun(); |
| 72 | |
| 73 | comm::RetCode ret{InitMasterRate()}; |
| 74 | if (comm::RetCode::RET_OK != ret) { |
| 75 | QLErr("MASTERSTAT: InitMasterRate ret %d", ret); |
| 76 | |
| 77 | exit(-1); |
| 78 | } |
| 79 | |
| 80 | while (true) { |
| 81 | if (comm::RetCode::RET_OK != (ret = AdjustMasterRate())) { |
| 82 | QLErr("MASTERSTAT: AdjustMasterRate ret %d", ret); |
| 83 | } |
| 84 | if (comm::RetCode::RET_OK != (ret = KeepMaster())) { |
| 85 | QLErr("MASTERSTAT: KeepMaster ret %d", ret); |
| 86 | } |
| 87 | |
| 88 | QLInfo("sleep 10"); |
| 89 | sleep(10); |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | comm::RetCode KeepMasterThread::InitMasterRate() { |
| 94 | impl_->master_rate = 100; |
nothing calls this directly
no test coverage detected